Debian Codegraph @

test/lib__improve.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) 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 lib__improve.t - Test suite for BibTool library improve.
31
32 =head1 SYNOPSIS
33
34 lib__improve.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 warnings;
55 use BUnit;
56
57 #------------------------------------------------------------------------------
58 BUnit::run(name => 'lib__improve_1',
59 args => '-r improve',
60 ignore => 'TODO',
61 BIBTOOL => '.:../lib',
62 bib => <<__EOF__,
63 \@Manual{BibTool,
64 title = {BibTool},
65 author = {Gerd Neugebauer},
66 year = "1996-2019"
67 }
68 __EOF__
69 expected_err => '',
70 expected_out => <<__EOF__
71
72 \@Manual{ bibtool,
73 title = {BibTool},
74 author = {Gerd Neugebauer},
75 year = "1996--2019"
76 }
77 __EOF__
78 );
79
80 #------------------------------------------------------------------------------
81 BUnit::run(name => 'lib__improve_2',
82 args => '-r improve',
83 BIBTOOL => '.:../lib',
84 bib => <<__EOF__,
85 \@Manual{BibTool,
86 title = {BibTool},
87 author = {Gerd Neugebauer},
88 year = "2019"
89 }
90 __EOF__
91 expected_err => '',
92 expected_out => <<__EOF__
93
94 \@Manual{ bibtool,
95 title = {BibTool},
96 author = {Gerd Neugebauer},
97 year = 2019
98 }
99 __EOF__
100 );
101
102 #------------------------------------------------------------------------------
103 BUnit::run(name => 'lib__improve_3',
104 args => '-r improve',
105 BIBTOOL => '.:../lib',
106 bib => <<__EOF__,
107 \@Manual{BibTool,
108 title = {BibTool},
109 author = {Gerd Neugebauer},
110 year = ""
111 }
112 __EOF__
113 expected_err => '',
114 expected_out => <<__EOF__
115
116 \@Manual{ bibtool,
117 title = {BibTool},
118 author = {Gerd Neugebauer}
119 }
120 __EOF__
121 );
122
123 #------------------------------------------------------------------------------
124 BUnit::run(name => 'lib__improve_4',
125 args => '-r improve',
126 BIBTOOL => '.:../lib',
127 bib => <<__EOF__,
128 \@Manual{BibTool,
129 title = {BibTool},
130 author = {Gerd Neugebauer},
131 year = " "
132 }
133 __EOF__
134 expected_err => '',
135 expected_out => <<__EOF__
136
137 \@Manual{ bibtool,
138 title = {BibTool},
139 author = {Gerd Neugebauer}
140 }
141 __EOF__
142 );
143
144 #------------------------------------------------------------------------------
145 BUnit::run(name => 'lib__improve_5',
146 args => '-r improve',
147 BIBTOOL => '.:../lib',
148 bib => <<__EOF__,
149 \@Manual{BibTool,
150 title = {BibTool},
151 author = {Gerd Neugebauer},
152 year = {}
153 }
154 __EOF__
155 expected_err => '',
156 expected_out => <<__EOF__
157
158 \@Manual{ bibtool,
159 title = {BibTool},
160 author = {Gerd Neugebauer}
161 }
162 __EOF__
163 );
164
165 #------------------------------------------------------------------------------
166 BUnit::run(name => 'lib__improve_6',
167 args => '-r improve',
168 BIBTOOL => '.:../lib',
169 bib => <<__EOF__,
170 \@Manual{BibTool,
171 title = {BibTool},
172 author = {Gerd Neugebauer},
173 year = { }
174 }
175 __EOF__
176 expected_err => '',
177 expected_out => <<__EOF__
178
179 \@Manual{ bibtool,
180 title = {BibTool},
181 author = {Gerd Neugebauer}
182 }
183 __EOF__
184 );
185
186 #------------------------------------------------------------------------------
187 # Local Variables:
188 # mode: perl
189 # End: