Debian Codegraph @

test/expand_macros.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 expand_macros.t - Test suite for BibTool expand.macros.
31
32 =head1 SYNOPSIS
33
34 expand_macros.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 => 'expand_macros_1',
60 args => '-- expand.macros=on',
61 bib => <<__EOF__,
62 \@String{BT ="BibTool"}
63 \@String{TeX ="\\TeX"}
64
65 \@Manual{BibTool,
66 title = BT,
67 author = {Gerd Neugebauer},
68 year = 2011
69 }
70 __EOF__
71 expected_out => <<__EOF__,
72
73 \@Manual{ bibtool,
74 title = {BibTool},
75 author = {Gerd Neugebauer},
76 year = {2011}
77 }
78 __EOF__
79 expected_err => ''
80 );
81
82 #------------------------------------------------------------------------------
83 BUnit::run(name => 'expand_macros_2',
84 args => '-- expand.macros=on',
85 bib => <<__EOF__,
86 \@String{BT ="BibTool"}
87 \@String{TeX ="\\TeX"}
88
89 \@Manual{BibTool,
90 title = {The } # BT # " Manual",
91 author = {Gerd Neugebauer},
92 year = 2011
93 }
94 __EOF__
95 expected_out => <<__EOF__,
96
97 \@Manual{ bibtool,
98 title = {The BibTool Manual},
99 author = {Gerd Neugebauer},
100 year = {2011}
101 }
102 __EOF__
103 expected_err => ''
104 );
105
106 #------------------------------------------------------------------------------
107 # Local Variables:
108 # mode: perl
109 # End: