Debian Codegraph @

test/symbol_type.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 symbol_type.t - Test suite for BibTool symbol.type.
31
32 =head1 SYNOPSIS
33
34 symbol_type.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
57
58 #------------------------------------------------------------------------------
59 BUnit::run(name => 'symbol_type_0',
60 args => '-- symbol.type=123',
61 bib => '',
62 expected_out => <<__EOF__,
63 __EOF__
64 expected_err => <<__EOF__
65 *** BibTool: Unknown symbol type ignored.
66 __EOF__
67 );
68
69 #------------------------------------------------------------------------------
70 BUnit::run(name => 'symbol_type_1',
71 args => '-- symbol.type=xyz',
72 bib => '',
73 expected_out => <<__EOF__,
74 __EOF__
75 expected_err => <<__EOF__
76 *** BibTool: Unknown symbol type ignored.
77 __EOF__
78 );
79
80 #------------------------------------------------------------------------------
81 BUnit::run(name => 'symbol_type_2',
82 args => '-- symbol.type=upper',
83 bib => <<__EOF__,
84 \@String{BT ="BibTool"}
85
86 \@Manual{BibTool,
87 title = BT,
88 author = {Gerd Neugebauer},
89 year = 2011
90 }
91 __EOF__
92 expected_out => <<__EOF__,
93 \@STRING{BT = "BibTool" }
94
95 \@Manual{ bibtool,
96 TITLE = BT,
97 AUTHOR = {Gerd Neugebauer},
98 YEAR = 2011
99 }
100 __EOF__
101 expected_err => ''
102 );
103
104 #------------------------------------------------------------------------------
105 BUnit::run(name => 'symbol_type_3',
106 args => '-- symbol.type=lower',
107 bib => <<__EOF__,
108 \@String{BT ="BibTool"}
109
110 \@Manual{BibTool,
111 Title = BT,
112 Author = {Gerd Neugebauer},
113 Year = 2011
114 }
115 __EOF__
116 expected_out => <<__EOF__,
117 \@STRING{bt = "BibTool" }
118
119 \@Manual{ bibtool,
120 title = bt,
121 author = {Gerd Neugebauer},
122 year = 2011
123 }
124 __EOF__
125 expected_err => ''
126 );
127
128 #------------------------------------------------------------------------------
129 BUnit::run(name => 'symbol_type_4',
130 args => '-- symbol.type=cased',
131 bib => <<__EOF__,
132 \@String{BT ="BibTool"}
133
134 \@Manual{BibTool,
135 title = BT,
136 author = {Gerd Neugebauer},
137 year = 2011
138 }
139 __EOF__
140 expected_out => <<__EOF__,
141 \@STRING{Bt = "BibTool" }
142
143 \@Manual{ bibtool,
144 Title = Bt,
145 Author = {Gerd Neugebauer},
146 Year = 2011
147 }
148 __EOF__
149 expected_err => ''
150 );
151
152 #------------------------------------------------------------------------------
153 # Local Variables:
154 # mode: perl
155 # End: