Skip to content

Commit e6db77d

Browse files
committed
Test: Add missing encoder tests based on example data
1 parent cf748d2 commit e6db77d

33 files changed

+638
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
% Barcode Writer in Pure PostScript
2+
% https://bwipp.terryburton.co.uk
3+
%
4+
% Copyright (c) 2004-2025 Terry Burton
5+
6+
% vim: set ts=4 sw=4 et :
7+
8+
/azteccodecompact dup /uk.co.terryburton.bwipp findresource cvx def
9+
10+
/eq_tmpl {
11+
3 1 roll { 0 0 azteccodecompact /pixs get }
12+
dup 3 -1 roll 1 exch put
13+
dup 3 -1 roll 0 exch put
14+
isEqual
15+
} def
16+
17+
(1234) (dontdraw)
18+
[
19+
0 0 0 1 1 1 0 1 1 1 0 1 1 0 0
20+
1 1 0 0 1 0 1 1 0 0 0 1 1 1 0
21+
1 1 1 1 0 0 0 0 0 0 1 0 1 1 1
22+
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0
23+
0 1 1 1 0 0 0 0 0 0 0 1 1 1 1
24+
1 0 1 1 0 1 1 1 1 1 0 1 1 0 0
25+
1 0 0 1 0 1 0 0 0 1 0 1 1 1 1
26+
0 0 0 1 0 1 0 1 0 1 0 1 1 1 1
27+
1 0 0 1 0 1 0 0 0 1 0 1 0 1 0
28+
1 0 1 1 0 1 1 1 1 1 0 1 1 0 0
29+
1 1 1 1 0 0 0 0 0 0 0 1 1 0 1
30+
0 1 0 1 1 1 1 1 1 1 1 1 1 1 0
31+
1 1 0 0 0 0 1 0 1 0 0 0 0 1 0
32+
0 0 0 0 0 1 1 0 0 1 1 0 0 1 1
33+
1 0 1 1 0 0 0 1 1 1 1 1 1 0 0
34+
] eq_tmpl

tests/ps_tests/channelcode.ps.test

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
% Barcode Writer in Pure PostScript
2+
% https://bwipp.terryburton.co.uk
3+
%
4+
% Copyright (c) 2004-2025 Terry Burton
5+
6+
% vim: set ts=4 sw=4 et :
7+
8+
/channelcode dup /uk.co.terryburton.bwipp findresource cvx def
9+
10+
{ (3493) (dontdraw) channelcode /sbs get
11+
} [ 1 1 1 1 1 1 1 1 1 5 4 1 1 1 2 1 1 1 1 ] debugIsEqual

tests/ps_tests/code32.ps.test

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
% Barcode Writer in Pure PostScript
2+
% https://bwipp.terryburton.co.uk
3+
%
4+
% Copyright (c) 2004-2025 Terry Burton
5+
6+
% vim: set ts=4 sw=4 et :
7+
8+
/code32 dup /uk.co.terryburton.bwipp findresource cvx def
9+
10+
{ (01234567) (dontdraw) code32 /sbs get
11+
} [ 1 3 1 1 3 1 3 1 1 1 1 1 1 3 3 1 3 1 1 1 3 1 3 1 1 3 1 1 1 1 1 1 3 1 1 1 3 3 1 1 1 1 3 1 1 1 3 3 1 1 1 1 3 1 1 3 1 1 3 1 1 1 1 1 3 3 1 1 3 1 1 3 1 1 3 1 3 1 1 1 ] debugIsEqual
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
% Barcode Writer in Pure PostScript
2+
% https://bwipp.terryburton.co.uk
3+
%
4+
% Copyright (c) 2004-2025 Terry Burton
5+
6+
% vim: set ts=4 sw=4 et :
7+
8+
/datamatrixrectangular dup /uk.co.terryburton.bwipp findresource cvx def
9+
10+
/eq_tmpl {
11+
3 1 roll { 0 0 datamatrixrectangular /pixs get }
12+
dup 3 -1 roll 1 exch put
13+
dup 3 -1 roll 0 exch put
14+
isEqual
15+
} def
16+
17+
(1234) (dontdraw)
18+
[
19+
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
20+
1 1 0 0 0 1 0 1 1 1 1 1 0 1 1 0 0 1
21+
1 1 0 0 0 1 1 0 0 1 0 1 0 1 0 1 0 0
22+
1 1 0 0 1 1 0 0 1 1 0 1 1 0 1 1 0 1
23+
1 1 1 0 0 1 1 1 0 1 0 1 1 1 1 0 0 0
24+
1 0 0 1 0 1 0 0 0 0 0 0 1 1 0 1 1 1
25+
1 1 1 1 1 0 0 0 1 1 1 0 0 1 1 1 1 0
26+
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
27+
] eq_tmpl
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
% Barcode Writer in Pure PostScript
2+
% https://bwipp.terryburton.co.uk
3+
%
4+
% Copyright (c) 2004-2025 Terry Burton
5+
6+
% vim: set ts=4 sw=4 et :
7+
8+
/datamatrixrectangularextension dup /uk.co.terryburton.bwipp findresource cvx def
9+
10+
/eq_tmpl {
11+
3 1 roll { 0 0 datamatrixrectangularextension /pixs get }
12+
dup 3 -1 roll 1 exch put
13+
dup 3 -1 roll 0 exch put
14+
isEqual
15+
} def
16+
17+
(1234) (version=8x96 dontdraw)
18+
[
19+
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
20+
1 1 0 0 0 1 0 1 1 1 1 1 0 1 1 1 1 0 1 1 0 1 0 1 1 0 0 1 1 1 1 0 0 0 1 0 1 1 1 0 0 1 0 1 1 0 0 1 1 0 0 1 1 0 1 1 0 1 1 1 1 1 1 0 1 0 1 0 0 0 0 1 1 0 1 0 1 1 0 1 1 1 1 0 0 1 0 1 1 1 1 0 1 0 0 1
21+
1 1 0 0 0 1 1 0 0 0 0 1 1 0 0 1 1 0 1 0 0 0 1 0 1 0 1 0 1 1 1 0 1 1 0 1 0 1 0 0 1 1 0 1 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 1 1 0 0 0 0 1 1 1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1 1 1 1
27+
] eq_tmpl

tests/ps_tests/ean2.ps.test

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
% Barcode Writer in Pure PostScript
2+
% https://bwipp.terryburton.co.uk
3+
%
4+
% Copyright (c) 2004-2025 Terry Burton
5+
6+
% vim: set ts=4 sw=4 et :
7+
8+
/ean2 dup /uk.co.terryburton.bwipp findresource cvx def
9+
10+
{ (05) (dontdraw) ean2 /sbs get
11+
} [ 1 1 2 3 2 1 1 1 1 1 3 2 1 ] debugIsEqual

tests/ps_tests/ean5.ps.test

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
% Barcode Writer in Pure PostScript
2+
% https://bwipp.terryburton.co.uk
3+
%
4+
% Copyright (c) 2004-2025 Terry Burton
5+
6+
% vim: set ts=4 sw=4 et :
7+
8+
/ean5 dup /uk.co.terryburton.bwipp findresource cvx def
9+
10+
{ (90200) (dontdraw) ean5 /sbs get
11+
} [ 1 1 2 2 1 1 3 1 1 3 2 1 1 1 1 2 1 2 2 1 1 3 2 1 1 1 1 1 1 2 3 ] debugIsEqual
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
% Barcode Writer in Pure PostScript
2+
% https://bwipp.terryburton.co.uk
3+
%
4+
% Copyright (c) 2004-2025 Terry Burton
5+
6+
% vim: set ts=4 sw=4 et :
7+
8+
/flattermarken dup /uk.co.terryburton.bwipp findresource cvx def
9+
10+
{ (11099) (dontdraw) flattermarken /sbs get
11+
} [ 0 0 1 8 0 0 1 8 0 9 0 0 0 8 1 0 0 8 1 0 ] debugIsEqual
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
% Barcode Writer in Pure PostScript
2+
% https://bwipp.terryburton.co.uk
3+
%
4+
% Copyright (c) 2004-2025 Terry Burton
5+
6+
% vim: set ts=4 sw=4 et :
7+
8+
/gs1dldatamatrix dup /uk.co.terryburton.bwipp findresource cvx def
9+
10+
/eq_tmpl {
11+
3 1 roll { 0 0 gs1dldatamatrix /pixs get }
12+
dup 3 -1 roll 1 exch put
13+
dup 3 -1 roll 0 exch put
14+
isEqual
15+
} def
16+
17+
(https://id.gs1.org/01/09521234543213/22/ABC%2D123?99=XYZ-987) (dontdraw)
18+
[
19+
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
20+
1 1 0 0 1 0 1 1 1 0 0 0 0 0 1 1 1 0 0 1 0 1 0 0 1 0 0 0 1 1 1 1
21+
1 0 0 1 0 1 0 1 0 0 0 0 1 1 1 0 1 0 1 1 0 1 1 1 0 0 0 0 0 0 1 0
22+
1 0 0 0 0 0 0 1 0 1 1 0 1 1 1 1 1 0 0 1 1 1 1 0 0 1 0 0 0 1 1 1
23+
1 1 0 1 0 1 0 0 0 0 0 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 0 0
24+
1 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 1 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1
25+
1 1 1 0 1 1 1 0 0 1 0 1 1 1 1 0 1 1 0 1 0 0 0 0 1 0 0 1 1 1 1 0
26+
1 1 0 0 1 1 1 0 1 0 1 1 1 1 1 1 1 1 0 0 1 0 1 1 0 0 1 0 1 1 1 1
27+
1 1 1 1 0 1 0 0 0 0 0 1 1 0 0 0 1 1 1 0 0 1 1 1 0 0 1 1 0 1 0 0
28+
1 1 0 0 1 0 1 1 0 1 0 0 0 0 1 1 1 1 0 1 1 1 0 0 0 0 0 0 0 1 1 1
29+
1 0 0 0 1 0 0 0 0 0 0 1 1 1 0 0 1 1 0 1 0 0 0 1 1 1 0 0 1 1 1 0
30+
1 1 1 1 0 0 0 1 0 1 1 1 0 0 1 1 1 0 1 1 0 1 1 0 0 0 1 0 1 0 1 1
31+
1 1 0 0 0 1 1 1 0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1 0 1 0 1 0 0 0 1 0 0 1 1 1
47+
1 1 1 0 0 1 1 1 0 1 1 1 0 1 0 0 1 0 0 0 1 1 0 1 1 1 1 1 0 0 1 0
48+
1 1 1 1 1 1 1 1 0 0 1 1 0 0 1 1 1 0 0 1 0 0 0 0 0 0 0 1 1 1 1 1
49+
1 1 0 0 0 1 0 0 0 1 1 0 1 1 0 0 1 0 0 1 0 1 0 0 1 0 0 0 0 0 1 0
50+
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
51+
] eq_tmpl

tests/ps_tests/gs1dlqrcode.ps.test

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
% Barcode Writer in Pure PostScript
2+
% https://bwipp.terryburton.co.uk
3+
%
4+
% Copyright (c) 2004-2025 Terry Burton
5+
6+
% vim: set ts=4 sw=4 et :
7+
8+
/gs1dlqrcode dup /uk.co.terryburton.bwipp findresource cvx def
9+
10+
/eq_tmpl {
11+
3 1 roll { 0 0 gs1dlqrcode /pixs get }
12+
dup 3 -1 roll 1 exch put
13+
dup 3 -1 roll 0 exch put
14+
isEqual
15+
} def
16+
17+
(HTTPS://ID.GS1.ORG/01/09521234543213/22/ABC%2D123?99=XYZ-987) (dontdraw)
18+
[
19+
1 1 1 1 1 1 1 0 0 0 1 1 1 1 0 0 1 0 0 1 0 0 1 0 1 0 1 1 1 1 1 1 1
20+
1 0 0 0 0 0 1 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 1 0 1 0 0 0 0 0 1
21+
1 0 1 1 1 0 1 0 1 0 0 1 1 0 0 0 1 0 0 1 1 0 0 1 1 0 1 0 1 1 1 0 1
22+
1 0 1 1 1 0 1 0 0 0 1 1 0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 1 1 1 0 1
23+
1 0 1 1 1 0 1 0 0 0 0 0 0 0 1 0 0 1 1 1 0 1 1 0 0 0 1 0 1 1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