Debian Codegraph @

test/lib__check_y.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__check_y.t - Test suite for BibTool library check_y.
31
32 =head1 SYNOPSIS
33
34 lib__check_y.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__check_y_1',
59 args => '-r check_y',
60 BIBTOOL => '.:../lib',
61 bib => <<__EOF__,
62 \@Manual{BibTool,
63 title = {BibTool},
64 author = {Gerd Neugebauer},
65 year = "2019"
66 }
67 __EOF__
68 expected_err => ''
69 );
70
71 #------------------------------------------------------------------------------
72 BUnit::run(name => 'lib__check_y_2',
73 args => '-r check_y',
74 BIBTOOL => '.:../lib',
75 bib => <<__EOF__,
76 \@Manual{BibTool,
77 title = {BibTool},
78 author = {Gerd Neugebauer},
79 year = "99"
80 }
81 __EOF__
82 expected_err => ''
83 );
84
85 #------------------------------------------------------------------------------
86 BUnit::run(name => 'lib__check_y_10',
87 args => '-r check_y',
88 BIBTOOL => '.:../lib',
89 bib => <<__EOF__,
90 \@Manual{BibTool,
91 title = {BibTool},
92 author = {Gerd Neugebauer},
93 year = "219"
94 }
95 __EOF__
96 expected_err => "*** BibTool (line 1 in _test.bib): Manual bibtool: Semantic error. Year has to be a suitable number\n"
97 );
98
99 #------------------------------------------------------------------------------
100 BUnit::run(name => 'lib__check_y_11',
101 args => '-r check_y',
102 BIBTOOL => '.:../lib',
103 bib => <<__EOF__,
104 \@Manual{BibTool,
105 title = {BibTool},
106 author = {Gerd Neugebauer},
107 year = "1799"
108 }
109 __EOF__
110 expected_err => "*** BibTool (line 1 in _test.bib): Manual bibtool: Semantic error. Year has to be a suitable number\n"
111 );
112
113 #------------------------------------------------------------------------------
114 BUnit::run(name => 'lib__check_y_12',
115 args => '-r check_y',
116 BIBTOOL => '.:../lib',
117 bib => <<__EOF__,
118 \@Manual{BibTool,
119 title = {BibTool},
120 author = {Gerd Neugebauer},
121 year = "2100"
122 }
123 __EOF__
124 expected_err => "*** BibTool (line 1 in _test.bib): Manual bibtool: Semantic error. Year has to be a suitable number\n"
125 );
126
127 #------------------------------------------------------------------------------
128 # Local Variables:
129 # mode: perl
130 # End: