Debian Codegraph @

test/key_format.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_format.t - Test suite for BibTool key.format.
31
32 =head1 SYNOPSIS
33
34 key_format.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 =cut
52
53 use strict;
54 use BUnit;use warnings;
55
56 $ENV{'HOSTNAME'} = 'localhost' if not defined $ENV{'HOSTNAME'};
57
58 #------------------------------------------------------------------------------
59 BUnit::run(name => '_k_1',
60 args => '-k bib/xampl.bib',
61 expected_out => <<EOF,
62 \@PREAMBLE{ "\\newcommand{\\noopsort}[1]{} "
63 # "\\newcommand{\\printfirst}[2]{#1} "
64 # "\\newcommand{\\singleletter}[1]{#1} "
65 # "\\newcommand{\\switchargs}[2]{#2#1} " }
66 \@STRING{acm = "The OX Association for Computing Machinery" }
67 \@STRING{stoc = " Symposium on the Theory of Computing" }
68 \@STRING{stoc-key= "OX{\\singleletter{stoc}}" }
69
70 \@Article{ aamport:gnats,
71 author = {L[eslie] A. Aamport},
72 title = {The Gnats and Gnus Document Preparation System},
73 journal = {\\mbox{G-Animal's} Journal},
74 year = 1986
75 }
76
77 \@Article{ aamport:gnats*1,
78 author = {L[eslie] A. Aamport},
79 title = {The Gnats and Gnus Document Preparation System},
80 journal = {\\mbox{G-Animal's} Journal},
81 year = 1986,
82 volume = 41,
83 number = 7,
84 pages = "73+",
85 month = jul,
86 note = "This is a full ARTICLE entry"
87 }
88
89 \@Article{ aamport:gnats*2,
90 crossref = {gaj},
91 key = "",
92 author = {L[eslie] A. Aamport},
93 title = {The Gnats and Gnus Document Preparation System},
94 pages = "73+",
95 note = "This is a cross-referencing ARTICLE entry"
96 }
97
98 \@Article{ gaj,
99 key = "GAJ",
100 journal = {\\mbox{G-Animal\'s} Journal},
101 year = 1986,
102 volume = 41,
103 number = 7,
104 month = jul,
105 note = {The entire issue is devoted to gnats and gnus (this entry
106 is a cross-referenced ARTICLE (journal))}
107 }
108
109 \@InBook{ knuth:fundamental,
110 author = "Donald E. Knuth",
111 title = "Fundamental Algorithms",
112 publisher = "Addison-Wesley",
113 year = "{\\noopsort{1973b}}1973",
114 chapter = "1.2"
115 }
116
117 \@InBook{ knuth:fundamental*1,
118 author = "Donald E. Knuth",
119 title = "Fundamental Algorithms",
120 volume = 1,
121 series = "The Art of Computer Programming",
122 publisher = "Addison-Wesley",
123 address = "Reading, Massachusetts",
124 edition = "Second",
125 month = "10~" # jan,
126 year = "{\\noopsort{1973b}}1973",
127 type = "Section",
128 chapter = "1.2",
129 pages = "10--119",
130 note = "This is a full INBOOK entry"
131 }
132
133 \@InBook{ knuth:fundamental*2,
134 crossref = "knuth:art",
135 title = "Fundamental Algorithms",
136 volume = 1,
137 series = "The Art of Computer Programming",
138 edition = "Second",
139 year = "{\\noopsort{1973b}}1973",
140 type = "Section",
141 chapter = "1.2",
142 note = "This is a cross-referencing INBOOK entry"
143 }
144
145 \@Book{ knuth:seminumerical,
146 author = "Donald E. Knuth",
147 title = "Seminumerical Algorithms",
148 publisher = "Addison-Wesley",
149 year = "{\\noopsort{1973c}}1981"
150 }
151
152 \@Book{ knuth:seminumerical*1,
153 author = "Donald E. Knuth",
154 title = "Seminumerical Algorithms",
155 volume = 2,
156 series = "The Art of Computer Programming",
157 publisher = "Addison-Wesley",
158 address = "Reading, Massachusetts",
159 edition = "Second",
160 month = "10~" # jan,
161 year = "{\\noopsort{1973c}}1981",
162 note = "This is a full BOOK entry"
163 }
164
165 \@Book{ knuth:seminumerical*2,
166 crossref = "knuth:art",
167 title = "Seminumerical Algorithms",
168 volume = 2,
169 series = "The Art of Computer Programming",
170 edition = "Second",
171 year = "{\\noopsort{1973c}}1981",
172 note = "This is a cross-referencing BOOK entry"
173 }
174
175 \@Book{ knuth:art,
176 author = "Donald E. Knuth",
177 publisher = "Addison-Wesley",
178 title = "The Art of Computer Programming",
179 series = "Four volumes",
180 year = "{\\noopsort{1973a}}{\\switchargs{--90}{1968}}",
181 note = "Seven volumes planned (this is a cross-referenced set of
182 BOOKs)"
183 }
184
185 \@Booklet{ :programming,
186 key = "Kn{\\printfirst{v}{1987}}",
187 title = "The Programming of Computer Art"
188 }
189
190 \@Booklet{ knvth:programming,
191 author = "Jill C. Knvth",
192 title = "The Programming of Computer Art",
193 howpublished = "Vernier Art Center",
194 address = "Stanford, California",
195 month = feb,
196 year = 1988,
197 note = "This is a full BOOKLET entry"
198 }
199
200 \@InCollection{ lincoll:semigroups,
201 author = "Daniel D. Lincoll",
202 title = "Semigroups of Recurrences",
203 booktitle = "High Speed Computer and Algorithm Organization",
204 publisher = "Academic Press",
205 year = 1977
206 }
207
208 \@InCollection{ lincoll:semigroups*1,
209 author = "Daniel D. Lincoll",
210 title = "Semigroups of Recurrences",
211 editor = "David J. Lipcoll and D. H. Lawrie and A. H. Sameh",
212 booktitle = "High Speed Computer and Algorithm Organization",
213 number = 23,
214 series = "Fast Computers",
215 chapter = 3,
216 type = "Part",
217 pages = "179--183",
218 publisher = "Academic Press",
219 address = "New York",
220 edition = "Third",
221 month = sep,
222 year = 1977,
223 note = "This is a full INCOLLECTION entry"
224 }
225
226 \@InCollection{ lincoll:semigroups*2,
227 crossref = "lipcoll.lawrie.ea:high",
228 author = "Daniel D. Lincoll",
229 title = "Semigroups of Recurrences",
230 pages = "179--183",
231 note = "This is a cross-referencing INCOLLECTION entry"
232 }
233
234 \@Book{ lipcoll.lawrie.ea:high,
235 editor = "David J. Lipcoll and D. H. Lawrie and A. H. Sameh",
236 title = "High Speed Computer and Algorithm Organization",
237 booktitle = "High Speed Computer and Algorithm Organization",
238 number = 23,
239 series = "Fast Computers",
240 publisher = "Academic Press",
241 address = "New York",
242 edition = "Third",
243 month = sep,
244 year = 1977,
245 note = "This is a cross-referenced BOOK (collection) entry"
246 }
247
248 \@Manual{ :definitive,
249 key = "Manmaker",
250 title = "The Definitive Computer Manual"
251 }
252
253 \@Manual{ manmaker:definitive,
254 author = "Larry Manmaker",
255 title = "The Definitive Computer Manual",
256 organization = "Chips-R-Us",
257 address = "Silicon Valley",
258 edition = "Silver",
259 month = apr # "-" # may,
260 year = 1986,
261 note = "This is a full MANUAL entry"
262 }
263
264 \@MastersThesis{ masterly:mastering,
265 author = "{\\'{E}}douard Masterly",
266 title = "Mastering Thesis Writing",
267 school = "Stanford University",
268 year = 1988
269 }
270
271 \@MastersThesis{ masterly:mastering*1,
272 author = "{\\\'{E}}douard Masterly",
273 title = "Mastering Thesis Writing",
274 school = "Stanford University",
275 type = "Master\'s project",
276 address = "English Department",
277 month = jun # "-" # aug,
278 year = 1988,
279 note = "This is a full MASTERSTHESIS entry"
280 }
281
282 \@Misc{ missilany,
283 key = "Missilany",
284 note = "This is a minimal MISC entry"
285 }
286
287 \@Misc{ missilany:handing,
288 author = "Joe-Bob Missilany",
289 title = "Handing out random pamphlets in airports",
290 howpublished = "Handed out at O\'Hare",
291 month = oct,
292 year = 1984,
293 note = "This is a full MISC entry"
294 }
295
296 \@InProceedings{ oaho.ullman.ea:on,
297 author = "Alfred V. Oaho and Jeffrey D. Ullman and Mihalis
298 Yannakakis",
299 title = "On Notions of Information Transfer in {VLSI} Circuits",
300 booktitle = "Proc. Fifteenth Annual ACM" # stoc,
301 year = 1983
302 }
303
304 \@InProceedings{ oaho.ullman.ea:on*1,
305 author = "Alfred V. Oaho and Jeffrey D. Ullman and Mihalis
306 Yannakakis",
307 title = "On Notions of Information Transfer in {VLSI} Circuits",
308 editor = "Wizard V. Oz and Mihalis Yannakakis",
309 booktitle = "Proc. Fifteenth Annual ACM" # stoc,
310 number = 17,
311 series = "All ACM Conferences",
312 pages = "133--139",
313 month = mar,
314 year = 1983,
315 address = "Boston",
316 organization = acm,
317 publisher = "Academic Press",
318 note = "This is a full INPROCEDINGS entry"
319 }
320
321 \@InProceedings{ oaho.ullman.ea:on*2,
322 crossref = ":proc*1",
323 author = "Alfred V. Oaho and Jeffrey D. Ullman and Mihalis
324 Yannakakis",
325 title = "On Notions of Information Transfer in {VLSI} Circuits",
326 organization = "",
327 pages = "133--139",
328 note = "This is a cross-referencing INPROCEEDINGS entry"
329 }
330
331 \@Proceedings{ :proc,
332 key = stoc-key,
333 title = "Proc. Fifteenth Annual" # stoc,
334 year = 1983
335 }
336
337 \@Proceedings{ oz.yannakakis:proc,
338 editor = "Wizard V. Oz and Mihalis Yannakakis",
339 title = "Proc. Fifteenth Annual" # stoc,
340 number = 17,
341 series = "All ACM Conferences",
342 month = mar,
343 year = 1983,
344 address = "Boston",
345 organization = acm,
346 publisher = "Academic Press",
347 note = "This is a full PROCEEDINGS entry"
348 }
349
350 \@Proceedings{ :proc*1,
351 key = stoc-key,
352 organization = acm,
353 title = "Proc. Fifteenth Annual" # stoc,
354 address = "Boston",
355 year = 1983,
356 booktitle = "Proc. Fifteenth Annual ACM" # stoc,
357 note = "This is a cross-referenced PROCEEDINGS"
358 }
359
360 \@PhDThesis{ phony-baloney:fighting,
361 author = "F. Phidias Phony-Baloney",
362 title = "Fighting Fire with Fire: Festooning {F}rench Phrases",
363 school = "Fanstord University",
364 year = 1988
365 }
366
367 \@PhDThesis{ phony-baloney:fighting*1,
368 author = "F. Phidias Phony-Baloney",
369 title = "Fighting Fire with Fire: Festooning {F}rench Phrases",
370 school = "Fanstord University",
371 type = "{PhD} Dissertation",
372 address = "Department of French",
373 month = jun # "-" # aug,
374 year = 1988,
375 note = "This is a full PHDTHESIS entry"
376 }
377
378 \@TechReport{ terrific:on--n----n,
379 author = "Tom Terrific",
380 title = "An {\$O(n \\log n / \\! \\log\\log n)\$} Sorting Algorithm",
381 institution = "Fanstord University",
382 year = 1988
383 }
384
385 \@TechReport{ terrific:on--n----n*1,
386 author = "Tom T{\\\'{e}}rrific",
387 title = "An {\$O(n \\log n / \\! \\log\\log n)\$} Sorting Algorithm",
388 institution = "Fanstord University",
389 type = "Wishful Research Result",
390 number = "7",
391 address = "Computer Science Department, Fanstord, California",
392 month = oct,
393 year = 1988,
394 note = "This is a full TECHREPORT entry"
395 }
396
397 \@Unpublished{ underwood.net.ea:lower,
398 author = "Ulrich {\\"{U}}nderwood and Ned {\\~N}et and Paul {\\={P}}ot",
399 title = "Lower Bounds for Wishful Research Results",
400 note = "Talk at Fanstord University (this is a minimal UNPUBLISHED
401 entry)"
402 }
403
404 \@Unpublished{ underwood.net.ea:lower*1,
405 author = "Ulrich {\\"{U}}nderwood and Ned {\\~N}et and Paul {\\={P}}ot",
406 title = "Lower Bounds for Wishful Research Results",
407 month = nov # ", " # dec,
408 year = 1988,
409 note = "Talk at Fanstord University (this is a full UNPUBLISHED
410 entry)"
411 }
412
413 \@Misc{ volume-2,
414 key = {Volume-2},
415 note = "Volume~2 is listed under Knuth \\cite{book-full}"
416 }
417 EOF
418 expected_err => <<EOF);
419
420 *** BibTool WARNING (line 29 in ./bib/xampl.bib): 125 non-space characters ignored.
421 EOF
422
423 #------------------------------------------------------------------------------
424 BUnit::run(name => '_f_short_1',
425 args => '-f short bib/xampl.bib',
426 expected_out => <<EOF,
427 \@PREAMBLE{ "\\newcommand{\\noopsort}[1]{} "
428 # "\\newcommand{\\printfirst}[2]{#1} "
429 # "\\newcommand{\\singleletter}[1]{#1} "
430 # "\\newcommand{\\switchargs}[2]{#2#1} " }
431 \@STRING{acm = "The OX Association for Computing Machinery" }
432 \@STRING{stoc = " Symposium on the Theory of Computing" }
433 \@STRING{stoc-key= "OX{\\singleletter{stoc}}" }
434
435 \@Article{ aamport:gnats,
436 author = {L[eslie] A. Aamport},
437 title = {The Gnats and Gnus Document Preparation System},
438 journal = {\\mbox{G-Animal's} Journal},
439 year = 1986
440 }
441
442 \@Article{ aamport:gnats*1,
443 author = {L[eslie] A. Aamport},
444 title = {The Gnats and Gnus Document Preparation System},
445 journal = {\\mbox{G-Animal's} Journal},
446 year = 1986,
447 volume = 41,
448 number = 7,
449 pages = "73+",
450 month = jul,
451 note = "This is a full ARTICLE entry"
452 }
453
454 \@Article{ aamport:gnats*2,
455 crossref = {gaj},
456 key = "",
457 author = {L[eslie] A. Aamport},
458 title = {The Gnats and Gnus Document Preparation System},
459 pages = "73+",
460 note = "This is a cross-referencing ARTICLE entry"
461 }
462
463 \@Article{ gaj,
464 key = "GAJ",
465 journal = {\\mbox{G-Animal\'s} Journal},
466 year = 1986,
467 volume = 41,
468 number = 7,
469 month = jul,
470 note = {The entire issue is devoted to gnats and gnus (this entry
471 is a cross-referenced ARTICLE (journal))}
472 }
473
474 \@InBook{ knuth:fundamental,
475 author = "Donald E. Knuth",
476 title = "Fundamental Algorithms",
477 publisher = "Addison-Wesley",
478 year = "{\\noopsort{1973b}}1973",
479 chapter = "1.2"
480 }
481
482 \@InBook{ knuth:fundamental*1,
483 author = "Donald E. Knuth",
484 title = "Fundamental Algorithms",
485 volume = 1,
486 series = "The Art of Computer Programming",
487 publisher = "Addison-Wesley",
488 address = "Reading, Massachusetts",
489 edition = "Second",
490 month = "10~" # jan,
491 year = "{\\noopsort{1973b}}1973",
492 type = "Section",
493 chapter = "1.2",
494 pages = "10--119",
495 note = "This is a full INBOOK entry"
496 }
497
498 \@InBook{ knuth:fundamental*2,
499 crossref = "knuth:art",
500 title = "Fundamental Algorithms",
501 volume = 1,
502 series = "The Art of Computer Programming",
503 edition = "Second",
504 year = "{\\noopsort{1973b}}1973",
505 type = "Section",
506 chapter = "1.2",
507 note = "This is a cross-referencing INBOOK entry"
508 }
509
510 \@Book{ knuth:seminumerical,
511 author = "Donald E. Knuth",
512 title = "Seminumerical Algorithms",
513 publisher = "Addison-Wesley",
514 year = "{\\noopsort{1973c}}1981"
515 }
516
517 \@Book{ knuth:seminumerical*1,
518 author = "Donald E. Knuth",
519 title = "Seminumerical Algorithms",
520 volume = 2,
521 series = "The Art of Computer Programming",
522 publisher = "Addison-Wesley",
523 address = "Reading, Massachusetts",
524 edition = "Second",
525 month = "10~" # jan,
526 year = "{\\noopsort{1973c}}1981",
527 note = "This is a full BOOK entry"
528 }
529
530 \@Book{ knuth:seminumerical*2,
531 crossref = "knuth:art",
532 title = "Seminumerical Algorithms",
533 volume = 2,
534 series = "The Art of Computer Programming",
535 edition = "Second",
536 year = "{\\noopsort{1973c}}1981",
537 note = "This is a cross-referencing BOOK entry"
538 }
539
540 \@Book{ knuth:art,
541 author = "Donald E. Knuth",
542 publisher = "Addison-Wesley",
543 title = "The Art of Computer Programming",
544 series = "Four volumes",
545 year = "{\\noopsort{1973a}}{\\switchargs{--90}{1968}}",
546 note = "Seven volumes planned (this is a cross-referenced set of
547 BOOKs)"
548 }
549
550 \@Booklet{ :programming,
551 key = "Kn{\\printfirst{v}{1987}}",
552 title = "The Programming of Computer Art"
553 }
554
555 \@Booklet{ knvth:programming,
556 author = "Jill C. Knvth",
557 title = "The Programming of Computer Art",
558 howpublished = "Vernier Art Center",
559 address = "Stanford, California",
560 month = feb,
561 year = 1988,
562 note = "This is a full BOOKLET entry"
563 }
564
565 \@InCollection{ lincoll:semigroups,
566 author = "Daniel D. Lincoll",
567 title = "Semigroups of Recurrences",
568 booktitle = "High Speed Computer and Algorithm Organization",
569 publisher = "Academic Press",
570 year = 1977
571 }
572
573 \@InCollection{ lincoll:semigroups*1,
574 author = "Daniel D. Lincoll",
575 title = "Semigroups of Recurrences",
576 editor = "David J. Lipcoll and D. H. Lawrie and A. H. Sameh",
577 booktitle = "High Speed Computer and Algorithm Organization",
578 number = 23,
579 series = "Fast Computers",
580 chapter = 3,
581 type = "Part",
582 pages = "179--183",
583 publisher = "Academic Press",
584 address = "New York",
585 edition = "Third",
586 month = sep,
587 year = 1977,
588 note = "This is a full INCOLLECTION entry"
589 }
590
591 \@InCollection{ lincoll:semigroups*2,
592 crossref = "lipcoll.lawrie.ea:high",
593 author = "Daniel D. Lincoll",
594 title = "Semigroups of Recurrences",
595 pages = "179--183",
596 note = "This is a cross-referencing INCOLLECTION entry"
597 }
598
599 \@Book{ lipcoll.lawrie.ea:high,
600 editor = "David J. Lipcoll and D. H. Lawrie and A. H. Sameh",
601 title = "High Speed Computer and Algorithm Organization",
602 booktitle = "High Speed Computer and Algorithm Organization",
603 number = 23,
604 series = "Fast Computers",
605 publisher = "Academic Press",
606 address = "New York",
607 edition = "Third",
608 month = sep,
609 year = 1977,
610 note = "This is a cross-referenced BOOK (collection) entry"
611 }
612
613 \@Manual{ :definitive,
614 key = "Manmaker",
615 title = "The Definitive Computer Manual"
616 }
617
618 \@Manual{ manmaker:definitive,
619 author = "Larry Manmaker",
620 title = "The Definitive Computer Manual",
621 organization = "Chips-R-Us",
622 address = "Silicon Valley",
623 edition = "Silver",
624 month = apr # "-" # may,
625 year = 1986,
626 note = "This is a full MANUAL entry"
627 }
628
629 \@MastersThesis{ masterly:mastering,
630 author = "{\\'{E}}douard Masterly",
631 title = "Mastering Thesis Writing",
632 school = "Stanford University",
633 year = 1988
634 }
635
636 \@MastersThesis{ masterly:mastering*1,
637 author = "{\\\'{E}}douard Masterly",
638 title = "Mastering Thesis Writing",
639 school = "Stanford University",
640 type = "Master\'s project",
641 address = "English Department",
642 month = jun # "-" # aug,
643 year = 1988,
644 note = "This is a full MASTERSTHESIS entry"
645 }
646
647 \@Misc{ missilany,
648 key = "Missilany",
649 note = "This is a minimal MISC entry"
650 }
651
652 \@Misc{ missilany:handing,
653 author = "Joe-Bob Missilany",
654 title = "Handing out random pamphlets in airports",
655 howpublished = "Handed out at O\'Hare",
656 month = oct,
657 year = 1984,
658 note = "This is a full MISC entry"
659 }
660
661 \@InProceedings{ oaho.ullman.ea:on,
662 author = "Alfred V. Oaho and Jeffrey D. Ullman and Mihalis
663 Yannakakis",
664 title = "On Notions of Information Transfer in {VLSI} Circuits",
665 booktitle = "Proc. Fifteenth Annual ACM" # stoc,
666 year = 1983
667 }
668
669 \@InProceedings{ oaho.ullman.ea:on*1,
670 author = "Alfred V. Oaho and Jeffrey D. Ullman and Mihalis
671 Yannakakis",
672 title = "On Notions of Information Transfer in {VLSI} Circuits",
673 editor = "Wizard V. Oz and Mihalis Yannakakis",
674 booktitle = "Proc. Fifteenth Annual ACM" # stoc,
675 number = 17,
676 series = "All ACM Conferences",
677 pages = "133--139",
678 month = mar,
679 year = 1983,
680 address = "Boston",
681 organization = acm,
682 publisher = "Academic Press",
683 note = "This is a full INPROCEDINGS entry"
684 }
685
686 \@InProceedings{ oaho.ullman.ea:on*2,
687 crossref = ":proc*1",
688 author = "Alfred V. Oaho and Jeffrey D. Ullman and Mihalis
689 Yannakakis",
690 title = "On Notions of Information Transfer in {VLSI} Circuits",
691 organization = "",
692 pages = "133--139",
693 note = "This is a cross-referencing INPROCEEDINGS entry"
694 }
695
696 \@Proceedings{ :proc,
697 key = stoc-key,
698 title = "Proc. Fifteenth Annual" # stoc,
699 year = 1983
700 }
701
702 \@Proceedings{ oz.yannakakis:proc,
703 editor = "Wizard V. Oz and Mihalis Yannakakis",
704 title = "Proc. Fifteenth Annual" # stoc,
705 number = 17,
706 series = "All ACM Conferences",
707 month = mar,
708 year = 1983,
709 address = "Boston",
710 organization = acm,
711 publisher = "Academic Press",
712 note = "This is a full PROCEEDINGS entry"
713 }
714
715 \@Proceedings{ :proc*1,
716 key = stoc-key,
717 organization = acm,
718 title = "Proc. Fifteenth Annual" # stoc,
719 address = "Boston",
720 year = 1983,
721 booktitle = "Proc. Fifteenth Annual ACM" # stoc,
722 note = "This is a cross-referenced PROCEEDINGS"
723 }
724
725 \@PhDThesis{ phony-baloney:fighting,
726 author = "F. Phidias Phony-Baloney",
727 title = "Fighting Fire with Fire: Festooning {F}rench Phrases",
728 school = "Fanstord University",
729 year = 1988
730 }
731
732 \@PhDThesis{ phony-baloney:fighting*1,
733 author = "F. Phidias Phony-Baloney",
734 title = "Fighting Fire with Fire: Festooning {F}rench Phrases",
735 school = "Fanstord University",
736 type = "{PhD} Dissertation",
737 address = "Department of French",
738 month = jun # "-" # aug,
739 year = 1988,
740 note = "This is a full PHDTHESIS entry"
741 }
742
743 \@TechReport{ terrific:on--n----n,
744 author = "Tom Terrific",
745 title = "An {\$O(n \\log n / \\! \\log\\log n)\$} Sorting Algorithm",
746 institution = "Fanstord University",
747 year = 1988
748 }
749
750 \@TechReport{ terrific:on--n----n*1,
751 author = "Tom T{\\\'{e}}rrific",
752 title = "An {\$O(n \\log n / \\! \\log\\log n)\$} Sorting Algorithm",
753 institution = "Fanstord University",
754 type = "Wishful Research Result",
755 number = "7",
756 address = "Computer Science Department, Fanstord, California",
757 month = oct,
758 year = 1988,
759 note = "This is a full TECHREPORT entry"
760 }
761
762 \@Unpublished{ underwood.net.ea:lower,
763 author = "Ulrich {\\"{U}}nderwood and Ned {\\~N}et and Paul {\\={P}}ot",
764 title = "Lower Bounds for Wishful Research Results",
765 note = "Talk at Fanstord University (this is a minimal UNPUBLISHED
766 entry)"
767 }
768
769 \@Unpublished{ underwood.net.ea:lower*1,
770 author = "Ulrich {\\"{U}}nderwood and Ned {\\~N}et and Paul {\\={P}}ot",
771 title = "Lower Bounds for Wishful Research Results",
772 month = nov # ", " # dec,
773 year = 1988,
774 note = "Talk at Fanstord University (this is a full UNPUBLISHED
775 entry)"
776 }
777
778 \@Misc{ volume-2,
779 key = {Volume-2},
780 note = "Volume~2 is listed under Knuth \\cite{book-full}"
781 }
782 EOF
783 expected_err => <<EOF);
784
785 *** BibTool WARNING (line 29 in ./bib/xampl.bib): 125 non-space characters ignored.
786 EOF
787
788 #------------------------------------------------------------------------------
789 BUnit::run(name => '_K_1',
790 args => '-K bib/xampl.bib',
791 expected_put => <<EOF,
792 \@PREAMBLE{ "\\newcommand{\\noopsort}[1]{} "
793 # "\\newcommand{\\printfirst}[2]{#1} "
794 # "\\newcommand{\\singleletter}[1]{#1} "
795 # "\\newcommand{\\switchargs}[2]{#2#1} " }
796 \@STRING{acm = "The OX Association for Computing Machinery" }
797 \@STRING{stoc = " Symposium on the Theory of Computing" }
798 \@STRING{stoc-key= "OX{\\singleletter{stoc}}" }
799
800 \@Article{ aamport.la:gnats,
801 author = {L[eslie] A. Aamport},
802 title = {The Gnats and Gnus Document Preparation System},
803 journal = {\\mbox{G-Animal's} Journal},
804 year = 1986
805 }
806
807 \@Article{ aamport.la:gnats*1,
808 author = {L[eslie] A. Aamport},
809 title = {The Gnats and Gnus Document Preparation System},
810 journal = {\\mbox{G-Animal's} Journal},
811 year = 1986,
812 volume = 41,
813 number = 7,
814 pages = "73+",
815 month = jul,
816 note = "This is a full ARTICLE entry"
817 }
818
819 \@Article{ aamport.la:gnats*2,
820 crossref = {gaj},
821 key = "",
822 author = {L[eslie] A. Aamport},
823 title = {The Gnats and Gnus Document Preparation System},
824 pages = "73+",
825 note = "This is a cross-referencing ARTICLE entry"
826 }
827
828 \@Article{ gaj,
829 key = "GAJ",
830 journal = {\\mbox{G-Animal\'s} Journal},
831 year = 1986,
832 volume = 41,
833 number = 7,
834 month = jul,
835 note = {The entire issue is devoted to gnats and gnus (this entry
836 is a cross-referenced ARTICLE (journal))}
837 }
838
839 \@InBook{ knuth.de:fundamental,
840 author = "Donald E. Knuth",
841 title = "Fundamental Algorithms",
842 publisher = "Addison-Wesley",
843 year = "{\\noopsort{1973b}}1973",
844 chapter = "1.2"
845 }
846
847 \@InBook{ knuth.de:fundamental*1,
848 author = "Donald E. Knuth",
849 title = "Fundamental Algorithms",
850 volume = 1,
851 series = "The Art of Computer Programming",
852 publisher = "Addison-Wesley",
853 address = "Reading, Massachusetts",
854 edition = "Second",
855 month = "10~" # jan,
856 year = "{\\noopsort{1973b}}1973",
857 type = "Section",
858 chapter = "1.2",
859 pages = "10--119",
860 note = "This is a full INBOOK entry"
861 }
862
863 \@InBook{ knuth.de:fundamental*2,
864 crossref = "knuth.de:art",
865 title = "Fundamental Algorithms",
866 volume = 1,
867 series = "The Art of Computer Programming",
868 edition = "Second",
869 year = "{\\noopsort{1973b}}1973",
870 type = "Section",
871 chapter = "1.2",
872 note = "This is a cross-referencing INBOOK entry"
873 }
874
875 \@Book{ knuth.de:seminumerical,
876 author = "Donald E. Knuth",
877 title = "Seminumerical Algorithms",
878 publisher = "Addison-Wesley",
879 year = "{\\noopsort{1973c}}1981"
880 }
881
882 \@Book{ knuth.de:seminumerical*1,
883 author = "Donald E. Knuth",
884 title = "Seminumerical Algorithms",
885 volume = 2,
886 series = "The Art of Computer Programming",
887 publisher = "Addison-Wesley",
888 address = "Reading, Massachusetts",
889 edition = "Second",
890 month = "10~" # jan,
891 year = "{\\noopsort{1973c}}1981",
892 note = "This is a full BOOK entry"
893 }
894
895 \@Book{ knuth.de:seminumerical*2,
896 crossref = "knuth.de:art",
897 title = "Seminumerical Algorithms",
898 volume = 2,
899 series = "The Art of Computer Programming",
900 edition = "Second",
901 year = "{\\noopsort{1973c}}1981",
902 note = "This is a cross-referencing BOOK entry"
903 }
904
905 \@Book{ knuth.de:art,
906 author = "Donald E. Knuth",
907 publisher = "Addison-Wesley",
908 title = "The Art of Computer Programming",
909 series = "Four volumes",
910 year = "{\\noopsort{1973a}}{\\switchargs{--90}{1968}}",
911 note = "Seven volumes planned (this is a cross-referenced set of
912 BOOKs)"
913 }
914
915 \@Booklet{ :programming,
916 key = "Kn{\\printfirst{v}{1987}}",
917 title = "The Programming of Computer Art"
918 }
919
920 \@Booklet{ knvth.jc:programming,
921 author = "Jill C. Knvth",
922 title = "The Programming of Computer Art",
923 howpublished = "Vernier Art Center",
924 address = "Stanford, California",
925 month = feb,
926 year = 1988,
927 note = "This is a full BOOKLET entry"
928 }
929
930 \@InCollection{ lincoll.dd:semigroups,
931 author = "Daniel D. Lincoll",
932 title = "Semigroups of Recurrences",
933 booktitle = "High Speed Computer and Algorithm Organization",
934 publisher = "Academic Press",
935 year = 1977
936 }
937
938 \@InCollection{ lincoll.dd:semigroups*1,
939 author = "Daniel D. Lincoll",
940 title = "Semigroups of Recurrences",
941 editor = "David J. Lipcoll and D. H. Lawrie and A. H. Sameh",
942 booktitle = "High Speed Computer and Algorithm Organization",
943 number = 23,
944 series = "Fast Computers",
945 chapter = 3,
946 type = "Part",
947 pages = "179--183",
948 publisher = "Academic Press",
949 address = "New York",
950 edition = "Third",
951 month = sep,
952 year = 1977,
953 note = "This is a full INCOLLECTION entry"
954 }
955
956 \@InCollection{ lincoll.dd:semigroups*2,
957 crossref = "lipcoll.dj.lawrie.dh.ea:high",
958 author = "Daniel D. Lincoll",
959 title = "Semigroups of Recurrences",
960 pages = "179--183",
961 note = "This is a cross-referencing INCOLLECTION entry"
962 }
963
964 \@Book{ lipcoll.dj.lawrie.dh.ea:high,
965 editor = "David J. Lipcoll and D. H. Lawrie and A. H. Sameh",
966 title = "High Speed Computer and Algorithm Organization",
967 booktitle = "High Speed Computer and Algorithm Organization",
968 number = 23,
969 series = "Fast Computers",
970 publisher = "Academic Press",
971 address = "New York",
972 edition = "Third",
973 month = sep,
974 year = 1977,
975 note = "This is a cross-referenced BOOK (collection) entry"
976 }
977
978 \@Manual{ :definitive,
979 key = "Manmaker",
980 title = "The Definitive Computer Manual"
981 }
982
983 \@Manual{ manmaker.l:definitive,
984 author = "Larry Manmaker",
985 title = "The Definitive Computer Manual",
986 organization = "Chips-R-Us",
987 address = "Silicon Valley",
988 edition = "Silver",
989 month = apr # "-" # may,
990 year = 1986,
991 note = "This is a full MANUAL entry"
992 }
993
994 \@MastersThesis{ masterly.e:mastering,
995 author = "{\\'{E}}douard Masterly",
996 title = "Mastering Thesis Writing",
997 school = "Stanford University",
998 year = 1988
999 }
1000
1001 \@MastersThesis{ masterly.e:mastering*1,
1002 author = "{\\\'{E}}douard Masterly",
1003 title = "Mastering Thesis Writing",
1004 school = "Stanford University",
1005 type = "Master\'s project",
1006 address = "English Department",
1007 month = jun # "-" # aug,
1008 year = 1988,
1009 note = "This is a full MASTERSTHESIS entry"
1010 }
1011
1012 \@Misc{ missilany,
1013 key = "Missilany",
1014 note = "This is a minimal MISC entry"
1015 }
1016
1017 \@Misc{ missilany.j:handing,
1018 author = "Joe-Bob Missilany",
1019 title = "Handing out random pamphlets in airports",
1020 howpublished = "Handed out at O\'Hare",
1021 month = oct,
1022 year = 1984,
1023 note = "This is a full MISC entry"
1024 }
1025
1026 \@InProceedings{ oaho.av.ullman.jd.ea:on,
1027 author = "Alfred V. Oaho and Jeffrey D. Ullman and Mihalis
1028 Yannakakis",
1029 title = "On Notions of Information Transfer in {VLSI} Circuits",
1030 booktitle = "Proc. Fifteenth Annual ACM" # stoc,
1031 year = 1983
1032 }
1033
1034 \@InProceedings{ oaho.av.ullman.jd.ea:on*1,
1035 author = "Alfred V. Oaho and Jeffrey D. Ullman and Mihalis
1036 Yannakakis",
1037 title = "On Notions of Information Transfer in {VLSI} Circuits",
1038 editor = "Wizard V. Oz and Mihalis Yannakakis",
1039 booktitle = "Proc. Fifteenth Annual ACM" # stoc,
1040 number = 17,
1041 series = "All ACM Conferences",
1042 pages = "133--139",
1043 month = mar,
1044 year = 1983,
1045 address = "Boston",
1046 organization = acm,
1047 publisher = "Academic Press",
1048 note = "This is a full INPROCEDINGS entry"
1049 }
1050
1051 \@InProceedings{ oaho.av.ullman.jd.ea:on*2,
1052 crossref = ":proc*1",
1053 author = "Alfred V. Oaho and Jeffrey D. Ullman and Mihalis
1054 Yannakakis",
1055 title = "On Notions of Information Transfer in {VLSI} Circuits",
1056 organization = "",
1057 pages = "133--139",
1058 note = "This is a cross-referencing INPROCEEDINGS entry"
1059 }
1060
1061 \@Proceedings{ :proc,
1062 key = stoc-key,
1063 title = "Proc. Fifteenth Annual" # stoc,
1064 year = 1983
1065 }
1066
1067 \@Proceedings{ oz.wv.yannakakis.m:proc,
1068 editor = "Wizard V. Oz and Mihalis Yannakakis",
1069 title = "Proc. Fifteenth Annual" # stoc,
1070 number = 17,
1071 series = "All ACM Conferences",
1072 month = mar,
1073 year = 1983,
1074 address = "Boston",
1075 organization = acm,
1076 publisher = "Academic Press",
1077 note = "This is a full PROCEEDINGS entry"
1078 }
1079
1080 \@Proceedings{ :proc*1,
1081 key = stoc-key,
1082 organization = acm,
1083 title = "Proc. Fifteenth Annual" # stoc,
1084 address = "Boston",
1085 year = 1983,
1086 booktitle = "Proc. Fifteenth Annual ACM" # stoc,
1087 note = "This is a cross-referenced PROCEEDINGS"
1088 }
1089
1090 \@PhDThesis{ phony-baloney.fp:fighting,
1091 author = "F. Phidias Phony-Baloney",
1092 title = "Fighting Fire with Fire: Festooning {F}rench Phrases",
1093 school = "Fanstord University",
1094 year = 1988
1095 }
1096
1097 \@PhDThesis{ phony-baloney.fp:fighting*1,
1098 author = "F. Phidias Phony-Baloney",
1099 title = "Fighting Fire with Fire: Festooning {F}rench Phrases",
1100 school = "Fanstord University",
1101 type = "{PhD} Dissertation",
1102 address = "Department of French",
1103 month = jun # "-" # aug,
1104 year = 1988,
1105 note = "This is a full PHDTHESIS entry"
1106 }
1107
1108 \@TechReport{ terrific.t:on--n----n,
1109 author = "Tom Terrific",
1110 title = "An {\$O(n \\log n / \\! \\log\\log n)\$} Sorting Algorithm",
1111 institution = "Fanstord University",
1112 year = 1988
1113 }
1114
1115 \@TechReport{ terrific.t:on--n----n*1,
1116 author = "Tom T{\\\'{e}}rrific",
1117 title = "An {\$O(n \\log n / \\! \\log\\log n)\$} Sorting Algorithm",
1118 institution = "Fanstord University",
1119 type = "Wishful Research Result",
1120 number = "7",
1121 address = "Computer Science Department, Fanstord, California",
1122 month = oct,
1123 year = 1988,
1124 note = "This is a full TECHREPORT entry"
1125 }
1126
1127 \@Unpublished{ underwood.u.net.n.ea:lower,
1128 author = "Ulrich {\\"{U}}nderwood and Ned {\\~N}et and Paul {\\={P}}ot",
1129 title = "Lower Bounds for Wishful Research Results",
1130 note = "Talk at Fanstord University (this is a minimal UNPUBLISHED
1131 entry)"
1132 }
1133
1134 \@Unpublished{ underwood.u.net.n.ea:lower*1,
1135 author = "Ulrich {\\"{U}}nderwood and Ned {\\~N}et and Paul {\\={P}}ot",
1136 title = "Lower Bounds for Wishful Research Results",
1137 month = nov # ", " # dec,
1138 year = 1988,
1139 note = "Talk at Fanstord University (this is a full UNPUBLISHED
1140 entry)"
1141 }
1142
1143 \@Misc{ volume-2,
1144 key = {Volume-2},
1145 note = "Volume~2 is listed under Knuth \\cite{book-full}"
1146 }
1147 EOF
1148 expected_err => <<EOF);
1149
1150 *** BibTool WARNING (line 29 in ./bib/xampl.bib): 125 non-space characters ignored.
1151 EOF
1152
1153 #------------------------------------------------------------------------------
1154 BUnit::run(name => '_f_long_1',
1155 args => '-f long bib/xampl.bib',
1156 expected_put => <<EOF,
1157 \@PREAMBLE{ "\\newcommand{\\noopsort}[1]{} "
1158 # "\\newcommand{\\printfirst}[2]{#1} "
1159 # "\\newcommand{\\singleletter}[1]{#1} "
1160 # "\\newcommand{\\switchargs}[2]{#2#1} " }
1161 \@STRING{acm = "The OX Association for Computing Machinery" }
1162 \@STRING{stoc = " Symposium on the Theory of Computing" }
1163 \@STRING{stoc-key= "OX{\\singleletter{stoc}}" }
1164
1165 \@Article{ aamport.la:gnats,
1166 author = {L[eslie] A. Aamport},
1167 title = {The Gnats and Gnus Document Preparation System},
1168 journal = {\\mbox{G-Animal's} Journal},
1169 year = 1986
1170 }
1171
1172 \@Article{ aamport.la:gnats*1,
1173 author = {L[eslie] A. Aamport},
1174 title = {The Gnats and Gnus Document Preparation System},
1175 journal = {\\mbox{G-Animal's} Journal},
1176 year = 1986,
1177 volume = 41,
1178 number = 7,
1179 pages = "73+",
1180 month = jul,
1181 note = "This is a full ARTICLE entry"
1182 }
1183
1184 \@Article{ aamport.la:gnats*2,
1185 crossref = {gaj},
1186 key = "",
1187 author = {L[eslie] A. Aamport},
1188 title = {The Gnats and Gnus Document Preparation System},
1189 pages = "73+",
1190 note = "This is a cross-referencing ARTICLE entry"
1191 }
1192
1193 \@Article{ gaj,
1194 key = "GAJ",
1195 journal = {\\mbox{G-Animal\'s} Journal},
1196 year = 1986,
1197 volume = 41,
1198 number = 7,
1199 month = jul,
1200 note = {The entire issue is devoted to gnats and gnus (this entry
1201 is a cross-referenced ARTICLE (journal))}
1202 }
1203
1204 \@InBook{ knuth.de:fundamental,
1205 author = "Donald E. Knuth",
1206 title = "Fundamental Algorithms",
1207 publisher = "Addison-Wesley",
1208 year = "{\\noopsort{1973b}}1973",
1209 chapter = "1.2"
1210 }
1211
1212 \@InBook{ knuth.de:fundamental*1,
1213 author = "Donald E. Knuth",
1214 title = "Fundamental Algorithms",
1215 volume = 1,
1216 series = "The Art of Computer Programming",
1217 publisher = "Addison-Wesley",
1218 address = "Reading, Massachusetts",
1219 edition = "Second",
1220 month = "10~" # jan,
1221 year = "{\\noopsort{1973b}}1973",
1222 type = "Section",
1223 chapter = "1.2",
1224 pages = "10--119",
1225 note = "This is a full INBOOK entry"
1226 }
1227
1228 \@InBook{ knuth.de:fundamental*2,
1229 crossref = "knuth.de:art",
1230 title = "Fundamental Algorithms",
1231 volume = 1,
1232 series = "The Art of Computer Programming",
1233 edition = "Second",
1234 year = "{\\noopsort{1973b}}1973",
1235 type = "Section",
1236 chapter = "1.2",
1237 note = "This is a cross-referencing INBOOK entry"
1238 }
1239
1240 \@Book{ knuth.de:seminumerical,
1241 author = "Donald E. Knuth",
1242 title = "Seminumerical Algorithms",
1243 publisher = "Addison-Wesley",
1244 year = "{\\noopsort{1973c}}1981"
1245 }
1246
1247 \@Book{ knuth.de:seminumerical*1,
1248 author = "Donald E. Knuth",
1249 title = "Seminumerical Algorithms",
1250 volume = 2,
1251 series = "The Art of Computer Programming",
1252 publisher = "Addison-Wesley",
1253 address = "Reading, Massachusetts",
1254 edition = "Second",
1255 month = "10~" # jan,
1256 year = "{\\noopsort{1973c}}1981",
1257 note = "This is a full BOOK entry"
1258 }
1259
1260 \@Book{ knuth.de:seminumerical*2,
1261 crossref = "knuth.de:art",
1262 title = "Seminumerical Algorithms",
1263 volume = 2,
1264 series = "The Art of Computer Programming",
1265 edition = "Second",
1266 year = "{\\noopsort{1973c}}1981",
1267 note = "This is a cross-referencing BOOK entry"
1268 }
1269
1270 \@Book{ knuth.de:art,
1271 author = "Donald E. Knuth",
1272 publisher = "Addison-Wesley",
1273 title = "The Art of Computer Programming",
1274 series = "Four volumes",
1275 year = "{\\noopsort{1973a}}{\\switchargs{--90}{1968}}",
1276 note = "Seven volumes planned (this is a cross-referenced set of
1277 BOOKs)"
1278 }
1279
1280 \@Booklet{ :programming,
1281 key = "Kn{\\printfirst{v}{1987}}",
1282 title = "The Programming of Computer Art"
1283 }
1284
1285 \@Booklet{ knvth.jc:programming,
1286 author = "Jill C. Knvth",
1287 title = "The Programming of Computer Art",
1288 howpublished = "Vernier Art Center",
1289 address = "Stanford, California",
1290 month = feb,
1291 year = 1988,
1292 note = "This is a full BOOKLET entry"
1293 }
1294
1295 \@InCollection{ lincoll.dd:semigroups,
1296 author = "Daniel D. Lincoll",
1297 title = "Semigroups of Recurrences",
1298 booktitle = "High Speed Computer and Algorithm Organization",
1299 publisher = "Academic Press",
1300 year = 1977
1301 }
1302
1303 \@InCollection{ lincoll.dd:semigroups*1,
1304 author = "Daniel D. Lincoll",
1305 title = "Semigroups of Recurrences",
1306 editor = "David J. Lipcoll and D. H. Lawrie and A. H. Sameh",
1307 booktitle = "High Speed Computer and Algorithm Organization",
1308 number = 23,
1309 series = "Fast Computers",
1310 chapter = 3,
1311 type = "Part",
1312 pages = "179--183",
1313 publisher = "Academic Press",
1314 address = "New York",
1315 edition = "Third",
1316 month = sep,
1317 year = 1977,
1318 note = "This is a full INCOLLECTION entry"
1319 }
1320
1321 \@InCollection{ lincoll.dd:semigroups*2,
1322 crossref = "lipcoll.dj.lawrie.dh.ea:high",
1323 author = "Daniel D. Lincoll",
1324 title = "Semigroups of Recurrences",
1325 pages = "179--183",
1326 note = "This is a cross-referencing INCOLLECTION entry"
1327 }
1328
1329 \@Book{ lipcoll.dj.lawrie.dh.ea:high,
1330 editor = "David J. Lipcoll and D. H. Lawrie and A. H. Sameh",
1331 title = "High Speed Computer and Algorithm Organization",
1332 booktitle = "High Speed Computer and Algorithm Organization",
1333 number = 23,
1334 series = "Fast Computers",
1335 publisher = "Academic Press",
1336 address = "New York",
1337 edition = "Third",
1338 month = sep,
1339 year = 1977,
1340 note = "This is a cross-referenced BOOK (collection) entry"
1341 }
1342
1343 \@Manual{ :definitive,
1344 key = "Manmaker",
1345 title = "The Definitive Computer Manual"
1346 }
1347
1348 \@Manual{ manmaker.l:definitive,
1349 author = "Larry Manmaker",
1350 title = "The Definitive Computer Manual",
1351 organization = "Chips-R-Us",
1352 address = "Silicon Valley",
1353 edition = "Silver",
1354 month = apr # "-" # may,
1355 year = 1986,
1356 note = "This is a full MANUAL entry"
1357 }
1358
1359 \@MastersThesis{ masterly.e:mastering,
1360 author = "{\\'{E}}douard Masterly",
1361 title = "Mastering Thesis Writing",
1362 school = "Stanford University",
1363 year = 1988
1364 }
1365
1366 \@MastersThesis{ masterly.e:mastering*1,
1367 author = "{\\\'{E}}douard Masterly",
1368 title = "Mastering Thesis Writing",
1369 school = "Stanford University",
1370 type = "Master\'s project",
1371 address = "English Department",
1372 month = jun # "-" # aug,
1373 year = 1988,
1374 note = "This is a full MASTERSTHESIS entry"
1375 }
1376
1377 \@Misc{ missilany,
1378 key = "Missilany",
1379 note = "This is a minimal MISC entry"
1380 }
1381
1382 \@Misc{ missilany.j:handing,
1383 author = "Joe-Bob Missilany",
1384 title = "Handing out random pamphlets in airports",
1385 howpublished = "Handed out at O\'Hare",
1386 month = oct,
1387 year = 1984,
1388 note = "This is a full MISC entry"
1389 }
1390
1391 \@InProceedings{ oaho.av.ullman.jd.ea:on,
1392 author = "Alfred V. Oaho and Jeffrey D. Ullman and Mihalis
1393 Yannakakis",
1394 title = "On Notions of Information Transfer in {VLSI} Circuits",
1395 booktitle = "Proc. Fifteenth Annual ACM" # stoc,
1396 year = 1983
1397 }
1398
1399 \@InProceedings{ oaho.av.ullman.jd.ea:on*1,
1400 author = "Alfred V. Oaho and Jeffrey D. Ullman and Mihalis
1401 Yannakakis",
1402 title = "On Notions of Information Transfer in {VLSI} Circuits",
1403 editor = "Wizard V. Oz and Mihalis Yannakakis",
1404 booktitle = "Proc. Fifteenth Annual ACM" # stoc,
1405 number = 17,
1406 series = "All ACM Conferences",
1407 pages = "133--139",
1408 month = mar,
1409 year = 1983,
1410 address = "Boston",
1411 organization = acm,
1412 publisher = "Academic Press",
1413 note = "This is a full INPROCEDINGS entry"
1414 }
1415
1416 \@InProceedings{ oaho.av.ullman.jd.ea:on*2,
1417 crossref = ":proc*1",
1418 author = "Alfred V. Oaho and Jeffrey D. Ullman and Mihalis
1419 Yannakakis",
1420 title = "On Notions of Information Transfer in {VLSI} Circuits",
1421 organization = "",
1422 pages = "133--139",
1423 note = "This is a cross-referencing INPROCEEDINGS entry"
1424 }
1425
1426 \@Proceedings{ :proc,
1427 key = stoc-key,
1428 title = "Proc. Fifteenth Annual" # stoc,
1429 year = 1983
1430 }
1431
1432 \@Proceedings{ oz.wv.yannakakis.m:proc,
1433 editor = "Wizard V. Oz and Mihalis Yannakakis",
1434 title = "Proc. Fifteenth Annual" # stoc,
1435 number = 17,
1436 series = "All ACM Conferences",
1437 month = mar,
1438 year = 1983,
1439 address = "Boston",
1440 organization = acm,
1441 publisher = "Academic Press",
1442 note = "This is a full PROCEEDINGS entry"
1443 }
1444
1445 \@Proceedings{ :proc*1,
1446 key = stoc-key,
1447 organization = acm,
1448 title = "Proc. Fifteenth Annual" # stoc,
1449 address = "Boston",
1450 year = 1983,
1451 booktitle = "Proc. Fifteenth Annual ACM" # stoc,
1452 note = "This is a cross-referenced PROCEEDINGS"
1453 }
1454
1455 \@PhDThesis{ phony-baloney.fp:fighting,
1456 author = "F. Phidias Phony-Baloney",
1457 title = "Fighting Fire with Fire: Festooning {F}rench Phrases",
1458 school = "Fanstord University",
1459 year = 1988
1460 }
1461
1462 \@PhDThesis{ phony-baloney.fp:fighting*1,
1463 author = "F. Phidias Phony-Baloney",
1464 title = "Fighting Fire with Fire: Festooning {F}rench Phrases",
1465 school = "Fanstord University",
1466 type = "{PhD} Dissertation",
1467 address = "Department of French",
1468 month = jun # "-" # aug,
1469 year = 1988,
1470 note = "This is a full PHDTHESIS entry"
1471 }
1472
1473 \@TechReport{ terrific.t:on--n----n,
1474 author = "Tom Terrific",
1475 title = "An {\$O(n \\log n / \\! \\log\\log n)\$} Sorting Algorithm",
1476 institution = "Fanstord University",
1477 year = 1988
1478 }
1479
1480 \@TechReport{ terrific.t:on--n----n*1,
1481 author = "Tom T{\\\'{e}}rrific",
1482 title = "An {\$O(n \\log n / \\! \\log\\log n)\$} Sorting Algorithm",
1483 institution = "Fanstord University",
1484 type = "Wishful Research Result",
1485 number = "7",
1486 address = "Computer Science Department, Fanstord, California",
1487 month = oct,
1488 year = 1988,
1489 note = "This is a full TECHREPORT entry"
1490 }
1491
1492 \@Unpublished{ underwood.u.net.n.ea:lower,
1493 author = "Ulrich {\\"{U}}nderwood and Ned {\\~N}et and Paul {\\={P}}ot",
1494 title = "Lower Bounds for Wishful Research Results",
1495 note = "Talk at Fanstord University (this is a minimal UNPUBLISHED
1496 entry)"
1497 }
1498
1499 \@Unpublished{ underwood.u.net.n.ea:lower*1,
1500 author = "Ulrich {\\"{U}}nderwood and Ned {\\~N}et and Paul {\\={P}}ot",
1501 title = "Lower Bounds for Wishful Research Results",
1502 month = nov # ", " # dec,
1503 year = 1988,
1504 note = "Talk at Fanstord University (this is a full UNPUBLISHED
1505 entry)"
1506 }
1507
1508 \@Misc{ volume-2,
1509 key = {Volume-2},
1510 note = "Volume~2 is listed under Knuth \\cite{book-full}"
1511 }
1512 EOF
1513 expected_err => <<EOF);
1514
1515 *** BibTool WARNING (line 29 in ./bib/xampl.bib): 125 non-space characters ignored.
1516 EOF
1517
1518 #------------------------------------------------------------------------------
1519 BUnit::run(name => 'f_empty_1',
1520 args => '-f empty',
1521 bib => <<EOF,
1522 \@Article{ aamport:1,
1523 author = {L[eslie] A. Aamport},
1524 title = {The Gnats and Gnus Document Preparation System},
1525 journal = {\\mbox{G-Animal's} Journal},
1526 year = 1986
1527 }
1528 \@Article{ gaj,
1529 key = "GAJ",
1530 journal = {\\mbox{G-Animal\'s} Journal},
1531 year = 1986,
1532 volume = 41,
1533 number = 7,
1534 month = jul,
1535 note = {The entire issue is devoted to gnats and gnus (this entry
1536 is a cross-referenced ARTICLE (journal))}
1537 }
1538 EOF
1539 expected_out => <<EOF,
1540
1541 \@Article{,
1542 author = {L[eslie] A. Aamport},
1543 title = {The Gnats and Gnus Document Preparation System},
1544 journal = {\\mbox{G-Animal's} Journal},
1545 year = 1986
1546 }
1547
1548 \@Article{,
1549 key = "GAJ",
1550 journal = {\\mbox{G-Animal\'s} Journal},
1551 year = 1986,
1552 volume = 41,
1553 number = 7,
1554 month = jul,
1555 note = {The entire issue is devoted to gnats and gnus (this entry
1556 is a cross-referenced ARTICLE (journal))}
1557 }
1558 EOF
1559 expected_err => <<EOF);
1560 EOF
1561
1562
1563 use constant DATA => <<__EOF__;
1564 \@Unpublished{unpublished-key,
1565 author = "First A. U. Thor and Seco N. D. Author and Third A. Uthor
1566 and others",
1567 title = "This is a rather long title of an unpublished entry which
1568 exceeds one line"
1569 }
1570 \@Article{,
1571 author = {L[eslie] A. Aamport},
1572 title = {The Gnats and Gnus Document Preparation System}
1573 }
1574 \@BOOK{whole-collection,
1575 editor = "David J. Lipcoll and D. H. Lawrie and A. H. Sameh",
1576 title = "High Speed Computer and Algorithm Organization"
1577 }
1578 \@MISC{misc-minimal,
1579 key = "Missilany",
1580 note = "This is a minimal MISC entry"
1581 }
1582 __EOF__
1583
1584 #------------------------------------------------------------------------------
1585 BUnit::run(name => 'key_format_1',
1586 args => '-- key.format={short}',
1587 bib => DATA,
1588 expected_out => <<__EOF__);
1589
1590 \@Unpublished{ thor.author.ea:this,
1591 author = "First A. U. Thor and Seco N. D. Author and Third A. Uthor
1592 and others",
1593 title = "This is a rather long title of an unpublished entry which
1594 exceeds one line"
1595 }
1596
1597 \@Article{ aamport:gnats,
1598 author = {L[eslie] A. Aamport},
1599 title = {The Gnats and Gnus Document Preparation System}
1600 }
1601
1602 \@Book{ lipcoll.lawrie.ea:high,
1603 editor = "David J. Lipcoll and D. H. Lawrie and A. H. Sameh",
1604 title = "High Speed Computer and Algorithm Organization"
1605 }
1606
1607 \@Misc{ missilany,
1608 key = "Missilany",
1609 note = "This is a minimal MISC entry"
1610 }
1611 __EOF__
1612
1613 #------------------------------------------------------------------------------
1614 BUnit::run(name => 'key_format_2',
1615 args => '-- key.format={long}',
1616 bib => DATA,
1617 expected_out => <<__EOF__);
1618
1619 \@Unpublished{ thor.fau.author.snd.ea:this,
1620 author = "First A. U. Thor and Seco N. D. Author and Third A. Uthor
1621 and others",
1622 title = "This is a rather long title of an unpublished entry which
1623 exceeds one line"
1624 }
1625
1626 \@Article{ aamport.la:gnats,
1627 author = {L[eslie] A. Aamport},
1628 title = {The Gnats and Gnus Document Preparation System}
1629 }
1630
1631 \@Book{ lipcoll.dj.lawrie.dh.ea:high,
1632 editor = "David J. Lipcoll and D. H. Lawrie and A. H. Sameh",
1633 title = "High Speed Computer and Algorithm Organization"
1634 }
1635
1636 \@Misc{ missilany,
1637 key = "Missilany",
1638 note = "This is a minimal MISC entry"
1639 }
1640 __EOF__
1641
1642 use constant SAMPLE => <<__EOF__;
1643 \@MISC{misc,
1644 author = "A. U. Thor and S. O. Meone and others"
1645 }
1646 __EOF__
1647
1648 #------------------------------------------------------------------------------
1649 BUnit::run(name => 'key_format_p1',
1650 resource => 'key.format={%p(author)}',
1651 bib => SAMPLE,
1652 expected_out => <<__EOF__);
1653
1654 \@Misc{ Thor.Meone.ea,
1655 author = "A. U. Thor and S. O. Meone and others"
1656 }
1657 __EOF__
1658
1659 #------------------------------------------------------------------------------
1660 BUnit::run(name => 'key_format_p2',
1661 resource => 'key.format={%1p(author)}',
1662 bib => SAMPLE,
1663 expected_out => <<__EOF__);
1664
1665 \@Misc{ Thor.ea,
1666 author = "A. U. Thor and S. O. Meone and others"
1667 }
1668 __EOF__
1669
1670 #------------------------------------------------------------------------------
1671 BUnit::run(name => 'key_format_p3',
1672 resource => 'key.format={%-2p(author)}',
1673 bib => SAMPLE,
1674 expected_out => <<__EOF__);
1675
1676 \@Misc{ thor.meone.ea,
1677 author = "A. U. Thor and S. O. Meone and others"
1678 }
1679 __EOF__
1680
1681 #------------------------------------------------------------------------------
1682 BUnit::run(name => 'key_format_p4',
1683 resource => 'key.format={%+1p(author)}',
1684 bib => SAMPLE,
1685 expected_out => <<__EOF__);
1686
1687 \@Misc{ THOR.EA,
1688 author = "A. U. Thor and S. O. Meone and others"
1689 }
1690 __EOF__
1691
1692 #------------------------------------------------------------------------------
1693 BUnit::run(name => 'key_format_n1',
1694 resource => 'key.format={%n(author)}',
1695 bib => SAMPLE,
1696 expected_out => <<__EOF__);
1697
1698 \@Misc{ Thor.Meone.ea,
1699 author = "A. U. Thor and S. O. Meone and others"
1700 }
1701 __EOF__
1702
1703 #------------------------------------------------------------------------------
1704 BUnit::run(name => 'key_format_n2',
1705 resource => 'key.format={%1n(author)}',
1706 bib => SAMPLE,
1707 expected_out => <<__EOF__);
1708
1709 \@Misc{ Thor.ea,
1710 author = "A. U. Thor and S. O. Meone and others"
1711 }
1712 __EOF__
1713
1714 #------------------------------------------------------------------------------
1715 BUnit::run(name => 'key_format_n3',
1716 resource => 'key.format={%-2n(author)}',
1717 bib => SAMPLE,
1718 expected_out => <<__EOF__);
1719
1720 \@Misc{ thor.meone.ea,
1721 author = "A. U. Thor and S. O. Meone and others"
1722 }
1723 __EOF__
1724
1725 #------------------------------------------------------------------------------
1726 BUnit::run(name => 'key_format_n4',
1727 resource => 'key.format={%+1n(author)}',
1728 bib => SAMPLE,
1729 expected_out => <<__EOF__);
1730
1731 \@Misc{ THOR.EA,
1732 author = "A. U. Thor and S. O. Meone and others"
1733 }
1734 __EOF__
1735
1736 #------------------------------------------------------------------------------
1737 BUnit::run(name => 'key_format_n5',
1738 resource => 'key.format={%.3n(author)}',
1739 bib => SAMPLE,
1740 expected_out => <<__EOF__);
1741
1742 \@Misc{ Tho.Meo.ea,
1743 author = "A. U. Thor and S. O. Meone and others"
1744 }
1745 __EOF__
1746
1747 #------------------------------------------------------------------------------
1748 BUnit::run(name => 'key_format_N1',
1749 resource => 'key.format={%N(author)}',
1750 bib => SAMPLE,
1751 expected_out => <<__EOF__);
1752
1753 \@Misc{ Thor.AU.Meone.SO.ea,
1754 author = "A. U. Thor and S. O. Meone and others"
1755 }
1756 __EOF__
1757
1758 #------------------------------------------------------------------------------
1759 BUnit::run(name => 'key_format_N2',
1760 resource => 'key.format={%1N(author)}',
1761 bib => SAMPLE,
1762 expected_out => <<__EOF__);
1763
1764 \@Misc{ Thor.AU.ea,
1765 author = "A. U. Thor and S. O. Meone and others"
1766 }
1767 __EOF__
1768
1769 #------------------------------------------------------------------------------
1770 BUnit::run(name => 'key_format_N3',
1771 resource => 'key.format={%-2N(author)}',
1772 bib => SAMPLE,
1773 expected_out => <<__EOF__);
1774
1775 \@Misc{ thor.au.meone.so.ea,
1776 author = "A. U. Thor and S. O. Meone and others"
1777 }
1778 __EOF__
1779
1780 #------------------------------------------------------------------------------
1781 BUnit::run(name => 'key_format_N4',
1782 resource => 'key.format={%+1N(author)}',
1783 bib => SAMPLE,
1784 expected_out => <<__EOF__);
1785
1786 \@Misc{ THOR.AU.EA,
1787 author = "A. U. Thor and S. O. Meone and others"
1788 }
1789 __EOF__
1790
1791 #------------------------------------------------------------------------------
1792 BUnit::run(name => 'key_format_N5',
1793 resource => 'key.format={%.3N(author)}',
1794 bib => SAMPLE,
1795 expected_out => <<__EOF__);
1796
1797 \@Misc{ Tho.AU.Meo.SO.ea,
1798 author = "A. U. Thor and S. O. Meone and others"
1799 }
1800 __EOF__
1801
1802 use constant SAMPLE_NUM => <<__EOF__;
1803 \@MISC{misc,
1804 pages = {89--123}
1805 }
1806 __EOF__
1807
1808 #------------------------------------------------------------------------------
1809 BUnit::run(name => 'key_format_d1',
1810 resource => 'key.format={x%d(pages)}',
1811 bib => SAMPLE_NUM,
1812 expected_out => <<__EOF__);
1813
1814 \@Misc{ x89,
1815 pages = {89--123}
1816 }
1817 __EOF__
1818
1819 #------------------------------------------------------------------------------
1820 BUnit::run(name => 'key_format_d2',
1821 resource => 'key.format={x%1d(pages)}',
1822 bib => SAMPLE_NUM,
1823 expected_out => <<__EOF__);
1824
1825 \@Misc{ x9,
1826 pages = {89--123}
1827 }
1828 __EOF__
1829
1830 #------------------------------------------------------------------------------
1831 BUnit::run(name => 'key_format_d3',
1832 resource => 'key.format={x%4d(pages)}',
1833 bib => SAMPLE_NUM,
1834 expected_out => <<__EOF__);
1835
1836 \@Misc{ x89,
1837 pages = {89--123}
1838 }
1839 __EOF__
1840
1841 #------------------------------------------------------------------------------
1842 BUnit::run(name => 'key_format_d4',
1843 resource => 'key.format={x%-4d(pages)}',
1844 bib => SAMPLE_NUM,
1845 expected_out => <<__EOF__);
1846
1847 \@Misc{ x0089,
1848 pages = {89--123}
1849 }
1850 __EOF__
1851
1852 #------------------------------------------------------------------------------
1853 BUnit::run(name => 'key_format_d5',
1854 resource => 'key.format={x%-5.2d(pages)}',
1855 bib => SAMPLE_NUM,
1856 expected_out => <<__EOF__);
1857
1858 \@Misc{ x00123,
1859 pages = {89--123}
1860 }
1861 __EOF__
1862
1863 #------------------------------------------------------------------------------
1864 BUnit::run(name => 'key_format_d6',
1865 resource => 'key.format={x%+.3d(pages)}',
1866 bib => SAMPLE_NUM,
1867 expected_out => <<__EOF__);
1868
1869 \@Misc{ x0,
1870 pages = {89--123}
1871 }
1872 __EOF__
1873
1874 #------------------------------------------------------------------------------
1875 BUnit::run(name => 'key_format_d7',
1876 resource => 'key.format={x%0d(pages)}',
1877 bib => SAMPLE_NUM,
1878 expected_out => <<__EOF__);
1879
1880 \@Misc{ x,
1881 pages = {89--123}
1882 }
1883 __EOF__
1884
1885 #------------------------------------------------------------------------------
1886 BUnit::run(name => 'key_format_d8',
1887 resource => 'key.format={x%.3d(pages)}',
1888 bib => SAMPLE_NUM,
1889 expected_out => <<__EOF__);
1890
1891 \@Misc{ **key*,
1892 pages = {89--123}
1893 }
1894 __EOF__
1895
1896 #------------------------------------------------------------------------------
1897 BUnit::run(name => 'key_format_D1',
1898 resource => 'key.format={x%D(pages)}',
1899 bib => SAMPLE_NUM,
1900 expected_out => <<__EOF__);
1901
1902 \@Misc{ x89,
1903 pages = {89--123}
1904 }
1905 __EOF__
1906
1907 #------------------------------------------------------------------------------
1908 BUnit::run(name => 'key_format_D2',
1909 resource => 'key.format={x%1D(pages)}',
1910 bib => SAMPLE_NUM,
1911 expected_out => <<__EOF__);
1912
1913 \@Misc{ x89,
1914 pages = {89--123}
1915 }
1916 __EOF__
1917
1918 #------------------------------------------------------------------------------
1919 BUnit::run(name => 'key_format_D3',
1920 resource => 'key.format={x%4D(pages)}',
1921 bib => SAMPLE_NUM,
1922 expected_out => <<__EOF__);
1923
1924 \@Misc{ x89,
1925 pages = {89--123}
1926 }
1927 __EOF__
1928
1929 #------------------------------------------------------------------------------
1930 BUnit::run(name => 'key_format_D4',
1931 resource => 'key.format={x%-4D(pages)}',
1932 bib => SAMPLE_NUM,
1933 expected_out => <<__EOF__);
1934
1935 \@Misc{ x0089,
1936 pages = {89--123}
1937 }
1938 __EOF__
1939
1940 #------------------------------------------------------------------------------
1941 BUnit::run(name => 'key_format_D5',
1942 resource => 'key.format={x%-5.2D(pages)}',
1943 bib => SAMPLE_NUM,
1944 expected_out => <<__EOF__);
1945
1946 \@Misc{ x00123,
1947 pages = {89--123}
1948 }
1949 __EOF__
1950
1951 #------------------------------------------------------------------------------
1952 BUnit::run(name => 'key_format_D6',
1953 resource => 'key.format={x%+.3D(pages)}',
1954 bib => SAMPLE_NUM,
1955 expected_out => <<__EOF__);
1956
1957 \@Misc{ x0,
1958 pages = {89--123}
1959 }
1960 __EOF__
1961
1962 #------------------------------------------------------------------------------
1963 BUnit::run(name => 'key_format_D7',
1964 resource => 'key.format={x%0D(pages)}',
1965 bib => SAMPLE_NUM,
1966 expected_out => <<__EOF__);
1967
1968 \@Misc{ x89,
1969 pages = {89--123}
1970 }
1971 __EOF__
1972
1973 #------------------------------------------------------------------------------
1974 BUnit::run(name => 'key_format_D8',
1975 resource => 'key.format={x%.3D(pages)}',
1976 bib => SAMPLE_NUM,
1977 expected_out => <<__EOF__);
1978
1979 \@Misc{ **key*,
1980 pages = {89--123}
1981 }
1982 __EOF__
1983
1984 #------------------------------------------------------------------------------
1985 BUnit::run(name => 'key_format_s1',
1986 resource => 'key.format={%s(author)}',
1987 bib => SAMPLE,
1988 expected_out => <<__EOF__);
1989
1990 \@Misc{ A.-U.-Thor-and-S.-O.-Meone-and-others,
1991 author = "A. U. Thor and S. O. Meone and others"
1992 }
1993 __EOF__
1994
1995 #------------------------------------------------------------------------------
1996 BUnit::run(name => 'key_format_s2',
1997 resource => 'key.format={%8s(author)}',
1998 bib => SAMPLE,
1999 expected_out => <<__EOF__);
2000
2001 \@Misc{ A.-U.-Th,
2002 author = "A. U. Thor and S. O. Meone and others"
2003 }
2004 __EOF__
2005
2006 #------------------------------------------------------------------------------
2007 BUnit::run(name => 'key_format_s3',
2008 resource => 'key.format={%-8s(author)}',
2009 bib => SAMPLE,
2010 expected_out => <<__EOF__);
2011
2012 \@Misc{ a.-u.-th,
2013 author = "A. U. Thor and S. O. Meone and others"
2014 }
2015 __EOF__
2016
2017 #------------------------------------------------------------------------------
2018 BUnit::run(name => 'key_format_s4',
2019 resource => 'key.format={%+8s(author)}',
2020 bib => SAMPLE,
2021 expected_out => <<__EOF__);
2022
2023 \@Misc{ A.-U.-TH,
2024 author = "A. U. Thor and S. O. Meone and others"
2025 }
2026 __EOF__
2027
2028 #------------------------------------------------------------------------------
2029 BUnit::run(name => 'key_format_s5',
2030 resource => 'key.format={x%0s(author)}',
2031 bib => SAMPLE,
2032 expected_out => <<__EOF__);
2033
2034 \@Misc{ x,
2035 author = "A. U. Thor and S. O. Meone and others"
2036 }
2037 __EOF__
2038
2039 use constant SAMPLE_TITLE => <<__EOF__;
2040 \@MISC{csim,
2041 title = "The Whole Title"
2042 }
2043 __EOF__
2044
2045 #------------------------------------------------------------------------------
2046 BUnit::run(name => 'key_format_T1',
2047 resource => 'key.format={%T(title)}',
2048 bib => SAMPLE_TITLE,
2049 expected_out => <<__EOF__);
2050
2051 \@Misc{ Whole,
2052 title = "The Whole Title"
2053 }
2054 __EOF__
2055
2056 #------------------------------------------------------------------------------
2057 BUnit::run(name => 'key_format_T2',
2058 resource => 'key.format={%2T(title)}',
2059 bib => SAMPLE_TITLE,
2060 expected_out => <<__EOF__);
2061
2062 \@Misc{ Whole-Title,
2063 title = "The Whole Title"
2064 }
2065 __EOF__
2066
2067 #------------------------------------------------------------------------------
2068 BUnit::run(name => 'key_format_T3',
2069 resource => 'key.format={%2.1T(title)}',
2070 bib => SAMPLE_TITLE,
2071 expected_out => <<__EOF__);
2072
2073 \@Misc{ W-T,
2074 title = "The Whole Title"
2075 }
2076 __EOF__
2077
2078 #------------------------------------------------------------------------------
2079 BUnit::run(name => 'key_format_T4',
2080 resource => 'key.format={%-T(title)}',
2081 bib => SAMPLE_TITLE,
2082 expected_out => <<__EOF__);
2083
2084 \@Misc{ whole,
2085 title = "The Whole Title"
2086 }
2087 __EOF__
2088
2089 #------------------------------------------------------------------------------
2090 BUnit::run(name => 'key_format_T5',
2091 resource => 'key.format={%+T(title)}',
2092 bib => SAMPLE_TITLE,
2093 expected_out => <<__EOF__);
2094
2095 \@Misc{ WHOLE,
2096 title = "The Whole Title"
2097 }
2098 __EOF__
2099
2100 #------------------------------------------------------------------------------
2101 BUnit::run(name => 'key_format_t1',
2102 resource => 'key.format={%t(title)}',
2103 bib => SAMPLE_TITLE,
2104 expected_out => <<__EOF__);
2105
2106 \@Misc{ The,
2107 title = "The Whole Title"
2108 }
2109 __EOF__
2110
2111 #------------------------------------------------------------------------------
2112 BUnit::run(name => 'key_format_t2',
2113 resource => 'key.format={%2t(title)}',
2114 bib => SAMPLE_TITLE,
2115 expected_out => <<__EOF__);
2116
2117 \@Misc{ The-Whole,
2118 title = "The Whole Title"
2119 }
2120 __EOF__
2121
2122 #------------------------------------------------------------------------------
2123 BUnit::run(name => 'key_format_t3',
2124 resource => 'key.format={%2.1t(title)}',
2125 bib => SAMPLE_TITLE,
2126 expected_out => <<__EOF__);
2127
2128 \@Misc{ T-W,
2129 title = "The Whole Title"
2130 }
2131 __EOF__
2132
2133 #------------------------------------------------------------------------------
2134 BUnit::run(name => 'key_format_t4',
2135 resource => 'key.format={%-t(title)}',
2136 bib => SAMPLE_TITLE,
2137 expected_out => <<__EOF__);
2138
2139 \@Misc{ the,
2140 title = "The Whole Title"
2141 }
2142 __EOF__
2143
2144 #------------------------------------------------------------------------------
2145 BUnit::run(name => 'key_format_t5',
2146 resource => 'key.format={%+t(title)}',
2147 bib => SAMPLE_TITLE,
2148 expected_out => <<__EOF__);
2149
2150 \@Misc{ THE,
2151 title = "The Whole Title"
2152 }
2153 __EOF__
2154
2155 #------------------------------------------------------------------------------
2156 BUnit::run(name => 'key_format_W1',
2157 resource => 'key.format={%W(title)}',
2158 bib => SAMPLE_TITLE,
2159 expected_out => <<__EOF__);
2160
2161 \@Misc{ Whole,
2162 title = "The Whole Title"
2163 }
2164 __EOF__
2165
2166 #------------------------------------------------------------------------------
2167 BUnit::run(name => 'key_format_W2',
2168 resource => 'key.format={%2W(title)}',
2169 bib => SAMPLE_TITLE,
2170 expected_out => <<__EOF__);
2171
2172 \@Misc{ WholeTitle,
2173 title = "The Whole Title"
2174 }
2175 __EOF__
2176
2177 #------------------------------------------------------------------------------
2178 BUnit::run(name => 'key_format_W3',
2179 resource => 'key.format={%2.1W(title)}',
2180 bib => SAMPLE_TITLE,
2181 expected_out => <<__EOF__);
2182
2183 \@Misc{ WT,
2184 title = "The Whole Title"
2185 }
2186 __EOF__
2187
2188 #------------------------------------------------------------------------------
2189 BUnit::run(name => 'key_format_W4',
2190 resource => 'key.format={%-W(title)}',
2191 bib => SAMPLE_TITLE,
2192 expected_out => <<__EOF__);
2193
2194 \@Misc{ whole,
2195 title = "The Whole Title"
2196 }
2197 __EOF__
2198
2199 #------------------------------------------------------------------------------
2200 BUnit::run(name => 'key_format_W5',
2201 resource => 'key.format={%+W(title)}',
2202 bib => SAMPLE_TITLE,
2203 expected_out => <<__EOF__);
2204
2205 \@Misc{ WHOLE,
2206 title = "The Whole Title"
2207 }
2208 __EOF__
2209
2210 #------------------------------------------------------------------------------
2211 BUnit::run(name => 'key_format_w1',
2212 resource => 'key.format={%w(title)}',
2213 bib => SAMPLE_TITLE,
2214 expected_out => <<__EOF__);
2215
2216 \@Misc{ The,
2217 title = "The Whole Title"
2218 }
2219 __EOF__
2220
2221 #------------------------------------------------------------------------------
2222 BUnit::run(name => 'key_format_w2',
2223 resource => 'key.format={%2w(title)}',
2224 bib => SAMPLE_TITLE,
2225 expected_out => <<__EOF__);
2226
2227 \@Misc{ TheWhole,
2228 title = "The Whole Title"
2229 }
2230 __EOF__
2231
2232 #------------------------------------------------------------------------------
2233 BUnit::run(name => 'key_format_w3',
2234 resource => 'key.format={%2.1w(title)}',
2235 bib => SAMPLE_TITLE,
2236 expected_out => <<__EOF__);
2237
2238 \@Misc{ TW,
2239 title = "The Whole Title"
2240 }
2241 __EOF__
2242
2243 #------------------------------------------------------------------------------
2244 BUnit::run(name => 'key_format_w4',
2245 resource => 'key.format={%-w(title)}',
2246 bib => SAMPLE_TITLE,
2247 expected_out => <<__EOF__);
2248
2249 \@Misc{ the,
2250 title = "The Whole Title"
2251 }
2252 __EOF__
2253
2254 #------------------------------------------------------------------------------
2255 BUnit::run(name => 'key_format_w5',
2256 resource => 'key.format={%+w(title)}',
2257 bib => SAMPLE_TITLE,
2258 expected_out => <<__EOF__);
2259
2260 \@Misc{ THE,
2261 title = "The Whole Title"
2262 }
2263 __EOF__
2264
2265 foreach $_ (qw/p n N/) {
2266 #------------------------------------------------------------------------------
2267 BUnit::run(name => "key_format_hash_${_}1",
2268 resource => "key.format={x%2#$_(author)}",
2269 bib => SAMPLE,
2270 expected_out => <<__EOF__);
2271
2272 \@Misc{ x,
2273 author = "A. U. Thor and S. O. Meone and others"
2274 }
2275 __EOF__
2276
2277 #------------------------------------------------------------------------------
2278 BUnit::run(name => "key_format_hash_${_}2",
2279 resource => "key.format={x%4#$_(author)}",
2280 bib => SAMPLE,
2281 expected_out => <<__EOF__);
2282
2283 \@Misc{ **key*,
2284 author = "A. U. Thor and S. O. Meone and others"
2285 }
2286 __EOF__
2287
2288 #------------------------------------------------------------------------------
2289 BUnit::run(name => "key_format_hash_${_}3",
2290 resource => "key.format={x%-4#$_(author)}",
2291 bib => SAMPLE,
2292 expected_out => <<__EOF__);
2293
2294 \@Misc{ x,
2295 author = "A. U. Thor and S. O. Meone and others"
2296 }
2297 __EOF__
2298
2299 #------------------------------------------------------------------------------
2300 BUnit::run(name => "key_format_hash_${_}4",
2301 resource => "key.format={x%3.4#$_(author)}",
2302 bib => SAMPLE,
2303 expected_out => <<__EOF__);
2304
2305 \@Misc{ x,
2306 author = "A. U. Thor and S. O. Meone and others"
2307 }
2308 __EOF__
2309
2310 #------------------------------------------------------------------------------
2311 BUnit::run(name => "key_format_hash_${_}5",
2312 resource => "key.format={x%-3.4#$_(author)}",
2313 bib => SAMPLE,
2314 expected_out => <<__EOF__);
2315
2316 \@Misc{ **key*,
2317 author = "A. U. Thor and S. O. Meone and others"
2318 }
2319 __EOF__
2320
2321 }
2322
2323 #------------------------------------------------------------------------------
2324 BUnit::run(name => "key_format_hash_s1",
2325 resource => "key.format={x%#s(title)}",
2326 bib => SAMPLE_TITLE,
2327 expected_out => <<__EOF__);
2328
2329 \@Misc{ x,
2330 title = "The Whole Title"
2331 }
2332 __EOF__
2333
2334 #------------------------------------------------------------------------------
2335 BUnit::run(name => "key_format_hash_s2",
2336 resource => "key.format={x%13.13#s(title)}",
2337 bib => SAMPLE_TITLE,
2338 expected_out => <<__EOF__);
2339
2340 \@Misc{ x,
2341 title = "The Whole Title"
2342 }
2343 __EOF__
2344
2345 #------------------------------------------------------------------------------
2346 BUnit::run(name => "key_format_hash_s3",
2347 resource => "key.format={x%10.16#s(title)}",
2348 bib => SAMPLE_TITLE,
2349 expected_out => <<__EOF__);
2350
2351 \@Misc{ x,
2352 title = "The Whole Title"
2353 }
2354 __EOF__
2355
2356 #------------------------------------------------------------------------------
2357 BUnit::run(name => "key_format_hash_s4",
2358 resource => "key.format={x%-10.16#s(title)}",
2359 bib => SAMPLE_TITLE,
2360 expected_out => <<__EOF__);
2361
2362 \@Misc{ **key*,
2363 title = "The Whole Title"
2364 }
2365 __EOF__
2366
2367
2368 foreach $_ (qw/w t/) {
2369 #------------------------------------------------------------------------------
2370 BUnit::run(name => "key_format_hash_${_}1",
2371 resource => "key.format={x%#$_(title)}",
2372 bib => SAMPLE_TITLE,
2373 expected_out => <<__EOF__);
2374
2375 \@Misc{ x,
2376 title = "The Whole Title"
2377 }
2378 __EOF__
2379
2380 #------------------------------------------------------------------------------
2381 BUnit::run(name => "key_format_hash_${_}2",
2382 resource => "key.format={x%3.3#$_(title)}",
2383 bib => SAMPLE_TITLE,
2384 expected_out => <<__EOF__);
2385
2386 \@Misc{ x,
2387 title = "The Whole Title"
2388 }
2389 __EOF__
2390
2391 #------------------------------------------------------------------------------
2392 BUnit::run(name => "key_format_hash_${_}3",
2393 resource => "key.format={x%1.6#$_(title)}",
2394 bib => SAMPLE_TITLE,
2395 expected_out => <<__EOF__);
2396
2397 \@Misc{ x,
2398 title = "The Whole Title"
2399 }
2400 __EOF__
2401
2402 #------------------------------------------------------------------------------
2403 BUnit::run(name => "key_format_hash_${_}4",
2404 resource => "key.format={x%-1.6#$_(title)}",
2405 bib => SAMPLE_TITLE,
2406 expected_out => <<__EOF__);
2407
2408 \@Misc{ **key*,
2409 title = "The Whole Title"
2410 }
2411 __EOF__
2412 }
2413
2414 foreach $_ (qw/W T/) {
2415 #------------------------------------------------------------------------------
2416 BUnit::run(name => "key_format_hash_${_}1",
2417 resource => "key.format={x%#$_(title)}",
2418 bib => SAMPLE_TITLE,
2419 expected_out => <<__EOF__);
2420
2421 \@Misc{ x,
2422 title = "The Whole Title"
2423 }
2424 __EOF__
2425
2426 #------------------------------------------------------------------------------
2427 BUnit::run(name => "key_format_hash_${_}2",
2428 resource => "key.format={x%2.2#$_(title)}",
2429 bib => SAMPLE_TITLE,
2430 expected_out => <<__EOF__);
2431
2432 \@Misc{ x,
2433 title = "The Whole Title"
2434 }
2435 __EOF__
2436
2437 #------------------------------------------------------------------------------
2438 BUnit::run(name => "key_format_hash_${_}3",
2439 resource => "key.format={x%1.6#$_(title)}",
2440 bib => SAMPLE_TITLE,
2441 expected_out => <<__EOF__);
2442
2443 \@Misc{ x,
2444 title = "The Whole Title"
2445 }
2446 __EOF__
2447
2448 #------------------------------------------------------------------------------
2449 BUnit::run(name => "key_format_hash_${_}4",
2450 resource => "key.format={x%-1.6#$_(title)}",
2451 bib => SAMPLE_TITLE,
2452 expected_out => <<__EOF__);
2453
2454 \@Misc{ **key*,
2455 title = "The Whole Title"
2456 }
2457 __EOF__
2458 }
2459
2460 #------------------------------------------------------------------------------
2461 BUnit::run(name => "key_format_dollar_key1",
2462 resource => "key.format={x%s(\$key)}",
2463 bib => SAMPLE_TITLE,
2464 expected_out => <<__EOF__);
2465
2466 \@Misc{ xcsim,
2467 title = "The Whole Title"
2468 }
2469 __EOF__
2470
2471 #------------------------------------------------------------------------------
2472 #BUnit::run(name => "key_format_dollar_sortkey1",
2473 # resource => "key.format={x%s(\$sortkey)}",
2474 # bib => SAMPLE_TITLE,
2475 # expected_out => <<__EOF__);
2476 #
2477 #\@Misc{ xcsim,
2478 # title = "The Whole Title"
2479 #}
2480 #__EOF__
2481
2482 #------------------------------------------------------------------------------
2483 BUnit::run(name => "key_format_dollar_type1",
2484 resource => "key.format={x%s(\$type)}",
2485 bib => SAMPLE_TITLE,
2486 expected_out => <<__EOF__);
2487
2488 \@Misc{ xMisc,
2489 title = "The Whole Title"
2490 }
2491 __EOF__
2492
2493 #------------------------------------------------------------------------------
2494 BUnit::run(name => "key_format_at_type1",
2495 resource => "key.format={x%s(\@Book)}",
2496 bib => SAMPLE_TITLE,
2497 expected_out => <<__EOF__);
2498
2499 \@Misc{ **key*,
2500 title = "The Whole Title"
2501 }
2502 __EOF__
2503
2504 #------------------------------------------------------------------------------
2505 BUnit::run(name => "key_format_at_type2",
2506 resource => "key.format={x%s(\@Misc)}",
2507 bib => SAMPLE_TITLE,
2508 expected_out => <<__EOF__);
2509
2510 \@Misc{ xMisc,
2511 title = "The Whole Title"
2512 }
2513 __EOF__
2514
2515 #------------------------------------------------------------------------------
2516 BUnit::run(name => "key_format_at_type3",
2517 resource => 'key.format={x%s(@MISC)}',
2518 bib => SAMPLE_TITLE,
2519 expected_out => <<__EOF__);
2520
2521 \@Misc{ xMisc,
2522 title = "The Whole Title"
2523 }
2524 __EOF__
2525
2526
2527 my ($sec,$minute,$hour,$day,$month,$year,$wday,$yday,$isdst) = localtime(time);
2528 $day = "0$day" if $day <= 9;
2529 $month++;
2530 $month = "0$month" if $month <= 9;
2531 $year += 1900;
2532 $hour = "0$hour" if $hour <= 9;
2533 $minute = "0$minute" if $minute <= 9;
2534
2535 #------------------------------------------------------------------------------
2536 BUnit::run(name => "key_format_dollar_day1",
2537 resource => 'key.format={x%s($day)}',
2538 bib => SAMPLE_TITLE,
2539 expected_out => <<__EOF__);
2540
2541 \@Misc{ x$day,
2542 title = "The Whole Title"
2543 }
2544 __EOF__
2545
2546 #------------------------------------------------------------------------------
2547 BUnit::run(name => "key_format_dollar_month1",
2548 resource => 'key.format={x%s($month)}',
2549 bib => SAMPLE_TITLE,
2550 expected_out => <<__EOF__);
2551
2552 \@Misc{ x$month,
2553 title = "The Whole Title"
2554 }
2555 __EOF__
2556
2557 #------------------------------------------------------------------------------
2558 BUnit::run(name => "key_format_dollar_year1",
2559 resource => 'key.format={x%s($year)}',
2560 bib => SAMPLE_TITLE,
2561 expected_out => <<__EOF__);
2562
2563 \@Misc{ x$year,
2564 title = "The Whole Title"
2565 }
2566 __EOF__
2567
2568 #------------------------------------------------------------------------------
2569 BUnit::run(name => "key_format_dollar_hour1",
2570 resource => 'key.format={x%s($hour)}',
2571 bib => SAMPLE_TITLE,
2572 expected_out => <<__EOF__);
2573
2574 \@Misc{ x$hour,
2575 title = "The Whole Title"
2576 }
2577 __EOF__
2578
2579 #------------------------------------------------------------------------------
2580 BUnit::run(name => "key_format_dollar_minute1",
2581 resource => 'key.format={x%s($minute)}',
2582 bib => SAMPLE_TITLE,
2583 expected_out => <<__EOF__);
2584
2585 \@Misc{ x$minute,
2586 title = "The Whole Title"
2587 }
2588 __EOF__
2589
2590 #------------------------------------------------------------------------------
2591 BUnit::run(name => "key_format_dollar_user1",
2592 resource => 'key.format={x%s($user)}',
2593 bib => SAMPLE_TITLE,
2594 expected_out => <<__EOF__);
2595
2596 \@Misc{ x$ENV{USER},
2597 title = "The Whole Title"
2598 }
2599 __EOF__
2600
2601 #------------------------------------------------------------------------------
2602 BUnit::run(name => "key_format_dollar_hostname1",
2603 resource => 'key.format={x%s($hostname)}',
2604 bib => SAMPLE_TITLE,
2605 expected_out => <<__EOF__);
2606
2607 \@Misc{ x$ENV{HOSTNAME},
2608 title = "The Whole Title"
2609 }
2610 __EOF__
2611
2612 #------------------------------------------------------------------------------
2613 BUnit::run(name => "key_format_or1",
2614 resource => 'key.format={x%#s(abc) # fallback}',
2615 bib => SAMPLE_TITLE,
2616 expected_out => <<__EOF__);
2617
2618 \@Misc{ fallback,
2619 title = "The Whole Title"
2620 }
2621 __EOF__
2622
2623 #------------------------------------------------------------------------------
2624 BUnit::run(name => "key_format_cond1",
2625 resource => 'key.format={(abc){then}{else}}',
2626 bib => SAMPLE_TITLE,
2627 expected_out => <<__EOF__);
2628
2629 \@Misc{ else,
2630 title = "The Whole Title"
2631 }
2632 __EOF__
2633
2634 #------------------------------------------------------------------------------
2635 BUnit::run(name => "key_format_cond2",
2636 resource => 'key.format={(title){then}{else}}',
2637 bib => SAMPLE_TITLE,
2638 expected_out => <<__EOF__);
2639
2640 \@Misc{ then,
2641 title = "The Whole Title"
2642 }
2643 __EOF__
2644
2645 #------------------------------------------------------------------------------
2646 BUnit::run(name => "key_format_cond3",
2647 resource => 'key.format={($key){then}{else}}',
2648 bib => SAMPLE_TITLE,
2649 expected_out => <<__EOF__);
2650
2651 \@Misc{ then,
2652 title = "The Whole Title"
2653 }
2654 __EOF__
2655
2656 #------------------------------------------------------------------------------
2657 BUnit::run(name => "key_format_group1",
2658 resource => 'key.format={{%N(author) # --no-author-- } {%T(title) # --no-title-- } x}',
2659 bib => SAMPLE_TITLE,
2660 expected_out => <<__EOF__);
2661
2662 \@Misc{ --no-author--Wholex,
2663 title = "The Whole Title"
2664 }
2665 __EOF__
2666
2667 1;
2668 #------------------------------------------------------------------------------
2669 # Local Variables:
2670 # mode: perl
2671 # End: