Skip to content

Commit 8152f03

Browse files
committed
Tests: New test for raiseerror
1 parent 0332ca2 commit 8152f03

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

tests/ps_tests/raiseerror.ps.test

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
% Barcode Writer in Pure PostScript
2+
% https://bwipp.terryburton.co.uk
3+
%
4+
% vim: set sw=4 sts=4 et:
5+
%
6+
% Copyright (c) 2004-2026 Terry Burton
7+
%
8+
9+
/raiseerror dup /uk.co.terryburton.bwipp findresource def
10+
11+
12+
%
13+
% Basic functionality: stopped returns true, errorname and errorinfo set
14+
%
15+
{
16+
{ /bwipp.testError (Test info) raiseerror } stopped
17+
$error /errorname get /bwipp.testError eq and
18+
$error /errorinfo get (Test info) eq and
19+
} true isEqual
20+
21+
22+
%
23+
% errorname is a name
24+
%
25+
{
26+
{ /bwipp.anotherError (Info) raiseerror } stopped pop
27+
$error /errorname get
28+
} /bwipp.anotherError isEqual
29+
30+
31+
%
32+
% errorinfo is a string
33+
%
34+
{
35+
{ /bwipp.test (Error information string) raiseerror } stopped pop
36+
$error /errorinfo get
37+
} (Error information string) isEqual
38+
39+
40+
%
41+
% errorinfo can be empty
42+
%
43+
{
44+
{ /bwipp.emptyInfo () raiseerror } stopped pop
45+
$error /errorinfo get
46+
} () isEqual
47+

tests/ps_tests/test.ps

49 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)