Debian Codegraph @

test/key_number_separator.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 # 8c) 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_number_separator.t - Test suite for BibTool key.number.separator.
31
32 =head1 SYNOPSIS
33
34 key_number_separator.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_number_separator_digit1',
79 resource => <<__EOF__ ,
80 key.number.separator = {--}
81 key.base = digit
82 key.format=short
83 __EOF__
84 bib => BIB2,
85 expected_out => <<__EOF__ );
86
87 \@Misc{ thor,
88 author = "A. U. Thor"
89 }
90
91 \@Misc{ thor--1,
92 author = "A. U. Thor"
93 }
94 __EOF__
95
96 #------------------------------------------------------------------------------
97 BUnit::run(name => 'key_number_separator_upper1',
98 resource => <<__EOF__ ,
99 key.number.separator = {--}
100 key.base = upper
101 key.format=short
102 __EOF__
103 bib => BIB2,
104 expected_out => <<__EOF__ );
105
106 \@Misc{ thor,
107 author = "A. U. Thor"
108 }
109
110 \@Misc{ thor--A,
111 author = "A. U. Thor"
112 }
113 __EOF__
114
115 #------------------------------------------------------------------------------
116 BUnit::run(name => 'key_number_separator_lower2',
117 resource => <<__EOF__ ,
118 key.number.separator = {--}
119 key.base = lower
120 key.format=short
121 __EOF__
122 bib => BIB2,
123 expected_out => <<__EOF__ );
124
125 \@Misc{ thor,
126 author = "A. U. Thor"
127 }
128
129 \@Misc{ thor--a,
130 author = "A. U. Thor"
131 }
132 __EOF__
133
134 1;
135 #------------------------------------------------------------------------------
136 # Local Variables:
137 # mode: perl
138 # End: