Skip to content

Commit fd54bd5

Browse files
committed
Split encoder tests into files named after the encoder
1 parent 2cc3eaa commit fd54bd5

15 files changed

Lines changed: 242 additions & 114 deletions

tests/ps_tests/azteccode.ps.test

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,6 @@
88
% vim: set ts=4 sw=4 et :
99

1010
/azteccode dup /uk.co.terryburton.bwipp findresource cvx def
11-
/aztecrune dup /uk.co.terryburton.bwipp findresource cvx def
12-
13-
/aztecrune_eq_tmpl {
14-
3 1 roll { 0 0 aztecrune /pixs get }
15-
dup 3 -1 roll 1 exch put
16-
dup 3 -1 roll 0 exch put
17-
isEqual
18-
} def
19-
20-
/aztecrune_er_tmpl {
21-
3 1 roll { 0 0 aztecrune /pixs get }
22-
dup 3 -1 roll 1 exch put
23-
dup 3 -1 roll 0 exch put
24-
exch isError
25-
} def
2611

2712

2813
% Punctuation-space combinations (PR #161)
@@ -228,38 +213,3 @@
228213
} [970 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 682 672 191] debugIsEqual
229214

230215

231-
% Aztec Runes
232-
233-
(0) (dontdraw)
234-
[
235-
1 1 1 0 1 0 1 0 1 0 1
236-
1 1 1 1 1 1 1 1 1 1 1
237-
0 1 0 0 0 0 0 0 0 1 0
238-
1 1 0 1 1 1 1 1 0 1 1
239-
0 1 0 1 0 0 0 1 0 1 0
240-
1 1 0 1 0 1 0 1 0 1 1
241-
0 1 0 1 0 0 0 1 0 1 0
242-
1 1 0 1 1 1 1 1 0 1 1
243-
0 1 0 0 0 0 0 0 0 1 0
244-
0 1 1 1 1 1 1 1 1 1 1
245-
0 0 1 0 1 0 1 0 1 0 0
246-
] aztecrune_eq_tmpl
247-
248-
(255) (dontdraw)
249-
[
250-
1 1 0 1 0 1 0 1 0 0 1
251-
1 1 1 1 1 1 1 1 1 1 1
252-
0 1 0 0 0 0 0 0 0 1 1
253-
1 1 0 1 1 1 1 1 0 1 1
254-
1 1 0 1 0 0 0 1 0 1 1
255-
0 1 0 1 0 1 0 1 0 1 1
256-
0 1 0 1 0 0 0 1 0 1 0
257-
1 1 0 1 1 1 1 1 0 1 1
258-
1 1 0 0 0 0 0 0 0 1 0
259-
0 1 1 1 1 1 1 1 1 1 1
260-
0 0 1 1 0 0 1 1 1 0 0
261-
] aztecrune_eq_tmpl
262-
263-
(/) (dontdraw) /bwipp.aztecRuneNotNumeric aztecrune_er_tmpl
264-
(:) (dontdraw) /bwipp.aztecRuneNotNumeric aztecrune_er_tmpl
265-
(256) (dontdraw) /bwipp.aztecRuneInvalid aztecrune_er_tmpl

tests/ps_tests/aztecrune.ps.test

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
% Barcode Writer in Pure PostScript
2+
% https://bwipp.terryburton.co.uk
3+
%
4+
% Copyright (c) 2004-2024 Terry Burton
5+
6+
% ISO/IEC 24778:2008
7+
8+
% vim: set ts=4 sw=4 et :
9+
10+
/aztecrune dup /uk.co.terryburton.bwipp findresource cvx def
11+
12+
/eq_tmpl {
13+
3 1 roll { 0 0 aztecrune /pixs get }
14+
dup 3 -1 roll 1 exch put
15+
dup 3 -1 roll 0 exch put
16+
isEqual
17+
} def
18+
19+
/er_tmpl {
20+
3 1 roll { 0 0 aztecrune /pixs get }
21+
dup 3 -1 roll 1 exch put
22+
dup 3 -1 roll 0 exch put
23+
exch isError
24+
} def
25+
26+
27+
% Aztec Runes
28+
29+
(0) (dontdraw)
30+
[
31+
1 1 1 0 1 0 1 0 1 0 1
32+
1 1 1 1 1 1 1 1 1 1 1
33+
0 1 0 0 0 0 0 0 0 1 0
34+
1 1 0 1 1 1 1 1 0 1 1
35+
0 1 0 1 0 0 0 1 0 1 0
36+
1 1 0 1 0 1 0 1 0 1 1
37+
0 1 0 1 0 0 0 1 0 1 0
38+
1 1 0 1 1 1 1 1 0 1 1
39+
0 1 0 0 0 0 0 0 0 1 0
40+
0 1 1 1 1 1 1 1 1 1 1
41+
0 0 1 0 1 0 1 0 1 0 0
42+
] eq_tmpl
43+
44+
(255) (dontdraw)
45+
[
46+
1 1 0 1 0 1 0 1 0 0 1
47+
1 1 1 1 1 1 1 1 1 1 1
48+
0 1 0 0 0 0 0 0 0 1 1
49+
1 1 0 1 1 1 1 1 0 1 1
50+
1 1 0 1 0 0 0 1 0 1 1
51+
0 1 0 1 0 1 0 1 0 1 1
52+
0 1 0 1 0 0 0 1 0 1 0
53+
1 1 0 1 1 1 1 1 0 1 1
54+
1 1 0 0 0 0 0 0 0 1 0
55+
0 1 1 1 1 1 1 1 1 1 1
56+
0 0 1 1 0 0 1 1 1 0 0
57+
] eq_tmpl
58+
59+
(/) (dontdraw) /bwipp.aztecRuneNotNumeric er_tmpl
60+
(:) (dontdraw) /bwipp.aztecRuneNotNumeric er_tmpl
61+
(256) (dontdraw) /bwipp.aztecRuneInvalid er_tmpl

tests/ps_tests/code2of5.ps.test

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,12 @@
66
% vim: set ts=4 sw=4 et :
77

88
/code2of5 dup /uk.co.terryburton.bwipp findresource cvx def
9-
/industrial2of5 dup /uk.co.terryburton.bwipp findresource cvx def
10-
/iata2of5 dup /uk.co.terryburton.bwipp findresource cvx def
11-
/matrix2of5 dup /uk.co.terryburton.bwipp findresource cvx def
12-
/coop2of5 dup /uk.co.terryburton.bwipp findresource cvx def
13-
/datalogic2of5 dup /uk.co.terryburton.bwipp findresource cvx def
149

1510

1611
% Input validation
1712

1813
{ () (dontdraw) code2of5
1914
} /bwipp.code2of5emptyData isError
20-
{ () (dontdraw) industrial2of5
21-
} /bwipp.code2of5emptyData isError
22-
{ () (dontdraw) iata2of5
23-
} /bwipp.code2of5emptyData isError
24-
{ () (dontdraw) matrix2of5
25-
} /bwipp.code2of5emptyData isError
26-
{ () (dontdraw) coop2of5
27-
} /bwipp.code2of5emptyData isError
28-
{ () (dontdraw) datalogic2of5
29-
} /bwipp.code2of5emptyData isError
3015

3116
{ () (dontdraw validatecheck) code2of5
3217
} /bwipp.code2of5emptyData isError
@@ -54,18 +39,3 @@
5439

5540
{ (87654321) (dontdraw) code2of5 /sbs get
5641
} [ 3 1 3 1 1 1 3 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 3 1 3 1 1 1 3 1 3 1 1 1 1 1 3 1 1 1 3 1 1 1 1 1 1 1 1 1 3 1 1 1 3 1 3 1 3 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 3 1 3 1 1 1 1 1 1 1 3 1 3 1 1 1 3 ] debugIsEqual
57-
58-
{ (87654321) (dontdraw) industrial2of5 /sbs get % Same as default
59-
} [ 3 1 3 1 1 1 3 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 3 1 3 1 1 1 3 1 3 1 1 1 1 1 3 1 1 1 3 1 1 1 1 1 1 1 1 1 3 1 1 1 3 1 3 1 3 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 3 1 3 1 1 1 1 1 1 1 3 1 3 1 1 1 3 ] debugIsEqual
60-
61-
{ (87654321) (dontdraw) iata2of5 /sbs get
62-
} [ 1 1 1 1 3 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 3 1 3 1 1 1 3 1 3 1 1 1 1 1 3 1 1 1 3 1 1 1 1 1 1 1 1 1 3 1 1 1 3 1 3 1 3 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 3 1 3 1 1 1 1 1 1 1 3 1 3 1 1 ] debugIsEqual
63-
64-
{ (87654321) (dontdraw) matrix2of5 /sbs get
65-
} [ 3 1 1 1 1 1 3 1 1 3 1 1 1 1 1 3 3 1 1 3 3 1 1 1 3 1 3 1 1 1 1 1 3 1 3 1 3 3 1 1 1 1 1 3 1 1 3 1 3 1 1 1 3 1 3 1 1 1 1 ] debugIsEqual
66-
67-
{ (87654321) (dontdraw) coop2of5 /sbs get
68-
} [ 3 1 3 1 3 1 1 3 1 1 3 1 1 1 3 1 1 3 3 1 1 1 1 3 1 3 1 1 1 3 1 1 3 1 1 1 3 3 1 1 1 1 3 1 3 1 1 1 1 3 3 1 1 3 3 ] debugIsEqual
69-
70-
{ (87654321) (dontdraw) datalogic2of5 /sbs get
71-
} [ 1 1 1 1 3 1 1 3 1 1 1 1 1 3 3 1 1 3 3 1 1 1 3 1 3 1 1 1 1 1 3 1 3 1 3 3 1 1 1 1 1 3 1 1 3 1 3 1 1 1 3 1 3 1 1 ] debugIsEqual

tests/ps_tests/code39.ps.test

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,21 @@
88
% vim: set ts=4 sw=4 et :
99

1010
/code39 dup /uk.co.terryburton.bwipp findresource cvx def
11-
/code39ext dup /uk.co.terryburton.bwipp findresource cvx def
1211

1312

1413
% Input validation
1514

1615
{ () (dontdraw) code39
1716
} /bwipp.code39emptyData isError
18-
{ () (dontdraw) code39ext
19-
} /bwipp.code39emptyData isError
2017

2118
{ () (dontdraw validatecheck) code39
2219
} /bwipp.code39emptyData isError
23-
{ () (dontdraw validatecheck) code39ext
24-
} /bwipp.code39emptyData isError
2520

2621
{ (,) (dontdraw) code39
2722
} /bwipp.code39badCharacter isError
2823

29-
{ (^161) (dontdraw parse) code39ext
30-
} /bwipp.code39extBadCharacter isError
31-
3224
{ (Z1.) (dontdraw validatecheck) code39 % Check digit should be '-'
3325
} /bwipp.code39badCheckDigit isError
34-
{ (Z1.) (dontdraw validatecheck) code39ext
35-
} /bwipp.code39badCheckDigit isError
3626

3727

3828
% Examples
@@ -48,6 +38,3 @@
4838

4939
{ (Z1-) (dontdraw validatecheck) code39 /sbs get
5040
} [ 1 3 1 1 3 1 3 1 1 1 1 3 3 1 3 1 1 1 1 1 3 1 1 3 1 1 1 1 3 1 1 3 1 1 1 1 3 1 3 1 1 3 1 1 3 1 3 1 1 1 ] debugIsEqual
51-
52-
{ (,I) (dontdraw validatecheck) code39ext /sbs get
53-
} [ 1 3 1 1 3 1 3 1 1 1 1 3 1 3 1 1 1 3 1 1 1 1 3 1 1 1 1 3 3 1 1 1 3 1 1 3 3 1 1 1 1 3 1 1 3 1 3 1 1 1 ] debugIsEqual

tests/ps_tests/code39ext.ps.test

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
% Barcode Writer in Pure PostScript
2+
% https://bwipp.terryburton.co.uk
3+
%
4+
% Copyright (c) 2004-2024 Terry Burton
5+
6+
% ISO/IEC 16388:2007
7+
8+
% vim: set ts=4 sw=4 et :
9+
10+
/code39ext dup /uk.co.terryburton.bwipp findresource cvx def
11+
12+
13+
% Input validation
14+
15+
{ () (dontdraw) code39ext
16+
} /bwipp.code39emptyData isError
17+
18+
{ () (dontdraw validatecheck) code39ext
19+
} /bwipp.code39emptyData isError
20+
21+
{ (^161) (dontdraw parse) code39ext
22+
} /bwipp.code39extBadCharacter isError
23+
24+
{ (Z1.) (dontdraw validatecheck) code39ext
25+
} /bwipp.code39badCheckDigit isError
26+
27+
28+
% Examples
29+
30+
{ (,I) (dontdraw validatecheck) code39ext /sbs get
31+
} [ 1 3 1 1 3 1 3 1 1 1 1 3 1 3 1 1 1 3 1 1 1 1 3 1 1 1 1 3 3 1 1 1 3 1 1 3 3 1 1 1 1 3 1 1 3 1 3 1 1 1 ] debugIsEqual

tests/ps_tests/code93.ps.test

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
% Barcode Writer in Pure PostScript
2+
% https://bwipp.terryburton.co.uk
3+
%
4+
% Copyright (c) 2004-2024 Terry Burton
5+
6+
% AIM USS Code 93 AIM-BC5-2000
7+
8+
% vim: set ts=4 sw=4 et :
9+
10+
/code93 dup /uk.co.terryburton.bwipp findresource cvx def
11+
12+
/eq_tmpl {
13+
exch { 0 (dontdraw includecheck) code93 /sbs get } dup 3 -1 roll 0 exch put
14+
exch isEqual
15+
} def
16+
17+
18+
% Non-shifts $/+%
19+
20+
($/+%)
21+
[1 1 1 1 4 1 3 2 1 1 1 1 1 1 2 1 3 1 1 1 3 1 2 1 2 1 1 1 3 1 1 2 1 1 2 2 1 1 1 2 2 2 1 1 1 1 4 1 1] eq_tmpl

tests/ps_tests/code93ext.ps.test

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,18 @@
88
% vim: set ts=4 sw=4 et :
99

1010
/code93ext dup /uk.co.terryburton.bwipp findresource cvx def
11-
/code93 dup /uk.co.terryburton.bwipp findresource cvx def
1211

1312
/eq_tmpl {
1413
exch { 0 (dontdraw parse includecheck) code93ext /sbs get } dup 3 -1 roll 0 exch put
1514
exch isEqual
1615
} def
1716

18-
/eq_nonext_tmpl {
19-
exch { 0 (dontdraw includecheck) code93 /sbs get } dup 3 -1 roll 0 exch put
20-
exch isEqual
21-
} def
22-
2317

2418
% Non-shifts $/+%
2519

26-
($/+%) % Same as non-extended below
20+
($/+%) % Same as non-extended
2721
[1 1 1 1 4 1 3 2 1 1 1 1 1 1 2 1 3 1 1 1 3 1 2 1 2 1 1 1 3 1 1 2 1 1 2 2 1 1 1 2 2 2 1 1 1 1 4 1 1] eq_tmpl
2822

29-
($/+%)
30-
[1 1 1 1 4 1 3 2 1 1 1 1 1 1 2 1 3 1 1 1 3 1 2 1 2 1 1 1 3 1 1 2 1 1 2 2 1 1 1 2 2 2 1 1 1 1 4 1 1] eq_nonext_tmpl
31-
3223
($%&^039()*+,-./)
3324
[1 1 1 1 4 1 3 2 1 1 1 1 2 1 1 1 3 1 3 1 1 1 2 1 2 3 1 1 1 1 3 1 1 1 2 1 1 1 2 1 1 3 3 1 1 1 2 1 1 1 2 2 1 2 3 1 1 1 2 1 1 1 2 3 1 1 3 1 1 1 2 1 1 2 2 1 1 2 1 1 3 1 2 1 3 1 1 1 2 1 1 1 1 1 2 3 1 2 1 1 3 1 3 1 1 1 1 2 1 1 2 1 3 1 2 1 2 2 1 1 1 1 1 1 1 4 1 1 1 1 4 1 1] eq_tmpl
3425

tests/ps_tests/coop2of5.ps.test

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
% Barcode Writer in Pure PostScript
2+
% https://bwipp.terryburton.co.uk
3+
%
4+
% Copyright (c) 2004-2024 Terry Burton
5+
6+
% vim: set ts=4 sw=4 et :
7+
8+
/coop2of5 dup /uk.co.terryburton.bwipp findresource cvx def
9+
10+
11+
% Input validation
12+
13+
{ () (dontdraw) coop2of5
14+
} /bwipp.code2of5emptyData isError
15+
16+
17+
% Examples
18+
19+
{ (87654321) (dontdraw) coop2of5 /sbs get
20+
} [ 3 1 3 1 3 1 1 3 1 1 3 1 1 1 3 1 1 3 3 1 1 1 1 3 1 3 1 1 1 3 1 1 3 1 1 1 3 3 1 1 1 1 3 1 3 1 1 1 1 3 3 1 1 3 3 ] debugIsEqual
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
% Barcode Writer in Pure PostScript
2+
% https://bwipp.terryburton.co.uk
3+
%
4+
% Copyright (c) 2004-2024 Terry Burton
5+
6+
% vim: set ts=4 sw=4 et :
7+
8+
/datalogic2of5 dup /uk.co.terryburton.bwipp findresource cvx def
9+
10+
11+
% Input validation
12+
13+
{ () (dontdraw) datalogic2of5
14+
} /bwipp.code2of5emptyData isError
15+
16+
17+
% Examples
18+
19+
{ (87654321) (dontdraw) datalogic2of5 /sbs get
20+
} [ 1 1 1 1 3 1 1 3 1 1 1 1 1 3 3 1 1 3 3 1 1 1 3 1 3 1 1 1 1 1 3 1 3 1 3 3 1 1 1 1 1 3 1 1 3 1 3 1 1 1 3 1 3 1 1 ] debugIsEqual

tests/ps_tests/gs1datamatrix.ps.test

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
% vim: set ts=4 sw=4 et :
99

1010
/gs1datamatrix dup /uk.co.terryburton.bwipp findresource cvx def
11-
/gs1datamatrixrectangular dup /uk.co.terryburton.bwipp findresource cvx def
1211

1312

1413
% GS Separator
@@ -21,13 +20,6 @@
2120
((01)00012345678905(17)180401(21)ABCDEFGHIJKL12345678(91)ABCDEFGHI123456789(92)abcdefghi) (debugcws gssep) gs1datamatrix
2221
} [232 131 130 131 153 175 197 219 135 147 148 134 131 151 230 89 233 109 36 128 95 147 154 32 56 51 115 70 161 183 78 89 233 109 36 128 95 254 142 164 186 208 58 30 222 239 89 233 109 36 128 95 254 129 229 124 20 170 65 215 110 6] debugIsEqual
2322

24-
{
25-
((01)00012345678905(17)180401(21)ABCDEFGHIJKL12345678(91)abcdefghi) (debugcws) gs1datamatrixrectangular % Figure 5.6.3.2-3 (right), not same, different encodation
26-
} [232 131 130 131 153 175 197 219 135 147 148 134 131 151 230 89 233 109 36 128 95 147 154 254 142 164 186 208 232 221 239 89 233 109 36 128 95 254 129 17 167 62 212 107 3 153 48 198 93] debugIsEqual
27-
28-
{
29-
((01)00012345678905(17)180401(21)ABCDEFGHIJKL12345678(91)abcdefghi) (debugcws gssep) gs1datamatrixrectangular
30-
} [232 131 130 131 153 175 197 219 135 147 148 134 131 151 230 89 233 109 36 128 95 147 154 254 142 164 186 208 30 221 239 89 233 109 36 128 95 254 129 17 167 62 212 107 3 153 48 198 93] debugIsEqual
3123

3224

3325
% Figures
@@ -57,9 +49,6 @@
5749
((01)09512345678901(15)170810(21)abcde) (debugcws) gs1datamatrix % Figure 5.6.2-1, same
5850
} [232 131 139 181 153 175 197 219 131 145 147 138 140 151 98 99 100 101 102 129 223 118] debugIsEqual
5951

60-
{
61-
((01)00012345678905(17)040115) (debugcws) gs1datamatrixrectangular % Figure 5.6.3.1-1 (left), same
62-
} [232 131 130 131 153 175 197 219 135 147 134 131 145 129 87 237] debugIsEqual
6352

6453
{
6554
((01)00012345678905(17)040115) (debugcws) gs1datamatrix % Figure 5.6.3.1-1 (right), same

0 commit comments

Comments
 (0)