Skip to content

Commit 933d7ad

Browse files
committed
renlinear: add tests for sbs beginning and ending with zero-width placeholders
1 parent 111c759 commit 933d7ad

1 file changed

Lines changed: 122 additions & 7 deletions

File tree

tests/ps_tests/renlinear.ps.test

Lines changed: 122 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,24 +213,139 @@
213213
72 1.5 0 1
214214
] debugIsEqual
215215

216+
%
217+
% Leading zero-width bar placeholder: sbs begins with 0 (idiom for leading space)
218+
%
219+
{
220+
0 0 moveto
221+
<<
222+
/ren /renlinear
223+
/sbs [0 1 1 1 1 1 1]
224+
/bhs [1 1 1 1 1 1 1]
225+
/bbs [0 0 0 0 0 0 0]
226+
/inkspread 0
227+
/opt << /debugbars true >>
228+
>> renlinear
229+
} [
230+
72 1.5 0 1
231+
72 3.5 0 1
232+
72 5.5 0 1
233+
] debugIsEqual
234+
235+
%
236+
% Leading zero-width bar placeholder with barratio: placeholder stays zero-width
237+
%
238+
{
239+
0 0 moveto
240+
<<
241+
/ren /renlinear
242+
/sbs [0 1 1 1 1 1 1]
243+
/bhs [1 1 1 1 1 1 1]
244+
/bbs [0 0 0 0 0 0 0]
245+
/inkspread 0
246+
/barratio 2
247+
/opt << /debugbars true >>
248+
>> renlinear
249+
} [
250+
72 1.5 0 1
251+
72 3.5 0 1
252+
72 5.5 0 1
253+
] debugIsEqual
254+
255+
%
256+
% Trailing zero-width bar placeholder: sbs ends with 0 (idiom for odd-length sbs whose semantic last element is a space)
257+
%
258+
{
259+
0 0 moveto
260+
<<
261+
/ren /renlinear
262+
/sbs [1 1 1 1 1 1 0]
263+
/bhs [1 1 1 1 1 1 1]
264+
/bbs [0 0 0 0 0 0 0]
265+
/inkspread 0
266+
/opt << /debugbars true >>
267+
>> renlinear
268+
} [
269+
72 0.5 0 1
270+
72 2.5 0 1
271+
72 4.5 0 1
272+
] debugIsEqual
273+
274+
%
275+
% Trailing zero-width bar placeholder with barratio
276+
%
277+
{
278+
0 0 moveto
279+
<<
280+
/ren /renlinear
281+
/sbs [1 1 1 1 1 1 0]
282+
/bhs [1 1 1 1 1 1 1]
283+
/bbs [0 0 0 0 0 0 0]
284+
/inkspread 0
285+
/barratio 2
286+
/opt << /debugbars true >>
287+
>> renlinear
288+
} [
289+
72 0.5 0 1
290+
72 2.5 0 1
291+
72 4.5 0 1
292+
] debugIsEqual
293+
294+
%
295+
% Leading and trailing zero-width bar placeholders combined
296+
%
297+
{
298+
0 0 moveto
299+
<<
300+
/ren /renlinear
301+
/sbs [0 1 1 1 1 1 0]
302+
/bhs [1 1 1 1 1 1 1]
303+
/bbs [0 0 0 0 0 0 0]
304+
/inkspread 0
305+
/opt << /debugbars true >>
306+
>> renlinear
307+
} [
308+
72 1.5 0 1
309+
72 3.5 0 1
310+
] debugIsEqual
311+
312+
%
313+
% Leading and trailing zero-width bar placeholders with barratio
314+
%
315+
{
316+
0 0 moveto
317+
<<
318+
/ren /renlinear
319+
/sbs [0 1 1 1 1 1 0]
320+
/bhs [1 1 1 1 1 1 1]
321+
/bbs [0 0 0 0 0 0 0]
322+
/inkspread 0
323+
/barratio 2
324+
/opt << /debugbars true >>
325+
>> renlinear
326+
} [
327+
72 1.5 0 1
328+
72 3.5 0 1
329+
] debugIsEqual
330+
216331
%
217332
% DataBar Omnidirectional
218333
%
219334
{
220335
0 0 moveto
221336
<<
222337
/ren /renlinear
223-
/sbs [1 5 1 1 1 5 1 1 1 2 3 8 1 1 4 3 1 1 1 1 2 2 3 4 1 1 2 2 1 1 1 1 4 7 2 5 1 2 1 2 1 1 3 1 1]
224-
/bhs [0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5]
225-
/bbs [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
338+
/sbs [0 1 1 5 1 1 1 5 1 1 1 2 3 8 1 1 4 3 1 1 1 1 2 2 3 4 1 1 2 2 1 1 1 1 4 7 2 5 1 2 1 2 1 1 3 1 1]
339+
/bhs [0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5]
340+
/bbs [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
226341
/inkspread 0
227342
/opt << /debugbars true >>
228343
>> renlinear
229344
} [
230-
36 0.5 0 1 36 6.5 0 1 36 8.5 0 1 36 14.5 0 1 36 16.5 0 1 36 20.5 0 3
231-
36 30.5 0 1 36 34 0 4 36 39.5 0 1 36 41.5 0 1 36 44 0 2 36 48.5 0 3
232-
36 54.5 0 1 36 57 0 2 36 60.5 0 1 36 62.5 0 1 36 66 0 4 36 76 0 2
233-
36 82.5 0 1 36 85.5 0 1 36 88.5 0 1 36 91.5 0 3 36 94.5 0 1
345+
36 1.5 0 1 36 7.5 0 1 36 9.5 0 1 36 15.5 0 1 36 17.5 0 1 36 21.5 0 3
346+
36 31.5 0 1 36 35 0 4 36 40.5 0 1 36 42.5 0 1 36 45 0 2 36 49.5 0 3
347+
36 55.5 0 1 36 58 0 2 36 61.5 0 1 36 63.5 0 1 36 67 0 4 36 77 0 2
348+
36 83.5 0 1 36 86.5 0 1 36 89.5 0 1 36 92.5 0 3 36 95.5 0 1
234349
] debugIsEqual
235350

236351

0 commit comments

Comments
 (0)