Debian Codegraph @

test/key_base.t

raw
1 #!/usr/bin/env perl
2 # =============================================================================
3 #
4 # This file is part of BibTool.
5 # It is distributed under the GNU General Public License.
6 # See the file COPYING for details.
7 #
8 # (c) 2011-2020 Gerd Neugebauer
9 #
10 # Net: [email protected]
11 #
12 # This program is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 2, or (at your option)
15 # any later version.
16 #
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
21 #
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write to the Free Software
24 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #
26 #*=============================================================================
27
28 =head1 NAME
29
30 key_base.t - Test suite for BibTool key.base.
31
32 =head1 SYNOPSIS
33
34 key_base.t
35
36 =head1 DESCRIPTION
37
38 This module contains some test cases. Running this module as program
39 will run all test cases and print a summary for each. Optionally files
40 *.out and *.err are left if the expected result does not match the
41 actual result.
42
43 =head1 OPTIONS
44
45 none
46
47 =head1 AUTHOR
48
49 Gerd Neugebauer
50
51 =head1 BUGS
52
53 =over 4
54
55 =item *
56
57 ...
58
59 =back
60
61 =cut
62
63 use strict;
64 use BUnit;use warnings;
65
66
67 use constant BIB2 => <<__EOF__;
68 \@Misc{ xxx,
69 author = "A. U. Thor"
70 }
71 \@Misc{ xxx,
72 author = "A. U. Thor"
73 }
74 __EOF__
75
76
77 #------------------------------------------------------------------------------
78 BUnit::run(name => 'key_base_digit1',
79 resource => <<__EOF__ ,
80 key.base = digit
81 key.format=short
82 __EOF__
83 bib => BIB2,
84 expected_out => <<__EOF__ );
85
86 \@Misc{ thor,
87 author = "A. U. Thor"
88 }
89
90 \@Misc{ thor*1,
91 author = "A. U. Thor"
92 }
93 __EOF__
94
95 #------------------------------------------------------------------------------
96 BUnit::run(name => 'key_base_digit2',
97 resource => <<__EOF__ ,
98 key.base = digit
99 key.format=short
100 __EOF__
101 bib =>
102 BIB2.BIB2.BIB2.BIB2.BIB2.BIB2,
103 expected_out => <<__EOF__ );
104
105 \@Misc{ thor,
106 author = "A. U. Thor"
107 }
108
109 \@Misc{ thor*1,
110 author = "A. U. Thor"
111 }
112
113 \@Misc{ thor*2,
114 author = "A. U. Thor"
115 }
116
117 \@Misc{ thor*3,
118 author = "A. U. Thor"
119 }
120
121 \@Misc{ thor*4,
122 author = "A. U. Thor"
123 }
124
125 \@Misc{ thor*5,
126 author = "A. U. Thor"
127 }
128
129 \@Misc{ thor*6,
130 author = "A. U. Thor"
131 }
132
133 \@Misc{ thor*7,
134 author = "A. U. Thor"
135 }
136
137 \@Misc{ thor*8,
138 author = "A. U. Thor"
139 }
140
141 \@Misc{ thor*9,
142 author = "A. U. Thor"
143 }
144
145 \@Misc{ thor*10,
146 author = "A. U. Thor"
147 }
148
149 \@Misc{ thor*11,
150 author = "A. U. Thor"
151 }
152 __EOF__
153
154
155 #------------------------------------------------------------------------------
156 BUnit::run(name => 'key_base_upper1',
157 resource => <<__EOF__ ,
158 key.base = upper
159 key.format=short
160 __EOF__
161 bib => BIB2,
162 expected_out => <<__EOF__ );
163
164 \@Misc{ thor,
165 author = "A. U. Thor"
166 }
167
168 \@Misc{ thor*A,
169 author = "A. U. Thor"
170 }
171 __EOF__
172
173 #------------------------------------------------------------------------------
174 BUnit::run(name => 'key_base_upper2',
175 resource => <<__EOF__ ,
176 key.base = upper
177 key.format=short
178 __EOF__
179 bib =>
180 BIB2.BIB2.BIB2.BIB2.BIB2.BIB2.BIB2.BIB2.BIB2.BIB2.BIB2.BIB2.BIB2.
181 BIB2,
182 expected_out => <<__EOF__ );
183
184 \@Misc{ thor,
185 author = "A. U. Thor"
186 }
187
188 \@Misc{ thor*A,
189 author = "A. U. Thor"
190 }
191
192 \@Misc{ thor*B,
193 author = "A. U. Thor"
194 }
195
196 \@Misc{ thor*C,
197 author = "A. U. Thor"
198 }
199
200 \@Misc{ thor*D,
201 author = "A. U. Thor"
202 }
203
204 \@Misc{ thor*E,
205 author = "A. U. Thor"
206 }
207
208 \@Misc{ thor*F,
209 author = "A. U. Thor"
210 }
211
212 \@Misc{ thor*G,
213 author = "A. U. Thor"
214 }
215
216 \@Misc{ thor*H,
217 author = "A. U. Thor"
218 }
219
220 \@Misc{ thor*I,
221 author = "A. U. Thor"
222 }
223
224 \@Misc{ thor*J,
225 author = "A. U. Thor"
226 }
227
228 \@Misc{ thor*K,
229 author = "A. U. Thor"
230 }
231
232 \@Misc{ thor*L,
233 author = "A. U. Thor"
234 }
235
236 \@Misc{ thor*M,
237 author = "A. U. Thor"
238 }
239
240 \@Misc{ thor*N,
241 author = "A. U. Thor"
242 }
243
244 \@Misc{ thor*O,
245 author = "A. U. Thor"
246 }
247
248 \@Misc{ thor*P,
249 author = "A. U. Thor"
250 }
251
252 \@Misc{ thor*Q,
253 author = "A. U. Thor"
254 }
255
256 \@Misc{ thor*R,
257 author = "A. U. Thor"
258 }
259
260 \@Misc{ thor*S,
261 author = "A. U. Thor"
262 }
263
264 \@Misc{ thor*T,
265 author = "A. U. Thor"
266 }
267
268 \@Misc{ thor*U,
269 author = "A. U. Thor"
270 }
271
272 \@Misc{ thor*V,
273 author = "A. U. Thor"
274 }
275
276 \@Misc{ thor*W,
277 author = "A. U. Thor"
278 }
279
280 \@Misc{ thor*X,
281 author = "A. U. Thor"
282 }
283
284 \@Misc{ thor*Y,
285 author = "A. U. Thor"
286 }
287
288 \@Misc{ thor*Z,
289 author = "A. U. Thor"
290 }
291
292 \@Misc{ thor*A_,
293 author = "A. U. Thor"
294 }
295 __EOF__
296
297
298 #------------------------------------------------------------------------------
299 BUnit::run(name => 'key_base_lower1',
300 resource => <<__EOF__ ,
301 key.base = lower
302 key.format=short
303 __EOF__
304 bib => BIB2,
305 expected_out => <<__EOF__ );
306
307 \@Misc{ thor,
308 author = "A. U. Thor"
309 }
310
311 \@Misc{ thor*a,
312 author = "A. U. Thor"
313 }
314 __EOF__
315
316 #------------------------------------------------------------------------------
317 BUnit::run(name => 'key_base_lower2',
318 resource => <<__EOF__ ,
319 key.base = lower
320 key.format=short
321 __EOF__
322 bib =>
323 BIB2.BIB2.BIB2.BIB2.BIB2.BIB2.BIB2.BIB2.BIB2.BIB2.BIB2.BIB2.BIB2.
324 BIB2,
325 expected_out => <<__EOF__ );
326
327 \@Misc{ thor,
328 author = "A. U. Thor"
329 }
330
331 \@Misc{ thor*a,
332 author = "A. U. Thor"
333 }
334
335 \@Misc{ thor*b,
336 author = "A. U. Thor"
337 }
338
339 \@Misc{ thor*c,
340 author = "A. U. Thor"
341 }
342
343 \@Misc{ thor*d,
344 author = "A. U. Thor"
345 }
346
347 \@Misc{ thor*e,
348 author = "A. U. Thor"
349 }
350
351 \@Misc{ thor*f,
352 author = "A. U. Thor"
353 }
354
355 \@Misc{ thor*g,
356 author = "A. U. Thor"
357 }
358
359 \@Misc{ thor*h,
360 author = "A. U. Thor"
361 }
362
363 \@Misc{ thor*i,
364 author = "A. U. Thor"
365 }
366
367 \@Misc{ thor*j,
368 author = "A. U. Thor"
369 }
370
371 \@Misc{ thor*k,
372 author = "A. U. Thor"
373 }
374
375 \@Misc{ thor*l,
376 author = "A. U. Thor"
377 }
378
379 \@Misc{ thor*m,
380 author = "A. U. Thor"
381 }
382
383 \@Misc{ thor*n,
384 author = "A. U. Thor"
385 }
386
387 \@Misc{ thor*o,
388 author = "A. U. Thor"
389 }
390
391 \@Misc{ thor*p,
392 author = "A. U. Thor"
393 }
394
395 \@Misc{ thor*q,
396 author = "A. U. Thor"
397 }
398
399 \@Misc{ thor*r,
400 author = "A. U. Thor"
401 }
402
403 \@Misc{ thor*s,
404 author = "A. U. Thor"
405 }
406
407 \@Misc{ thor*t,
408 author = "A. U. Thor"
409 }
410
411 \@Misc{ thor*u,
412 author = "A. U. Thor"
413 }
414
415 \@Misc{ thor*v,
416 author = "A. U. Thor"
417 }
418
419 \@Misc{ thor*w,
420 author = "A. U. Thor"
421 }
422
423 \@Misc{ thor*x,
424 author = "A. U. Thor"
425 }
426
427 \@Misc{ thor*y,
428 author = "A. U. Thor"
429 }
430
431 \@Misc{ thor*z,
432 author = "A. U. Thor"
433 }
434
435 \@Misc{ thor*a_,
436 author = "A. U. Thor"
437 }
438 __EOF__
439
440
441 1;
442 #------------------------------------------------------------------------------
443 # Local Variables:
444 # mode: perl
445 # End: