Debian Codegraph @

test/expand_xdata.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) 2016-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_xdata.t - Test suite for BibTool expand.xdata.
31
32 =head1 SYNOPSIS
33
34 expand_xdata.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 BUnit::run(name => 'expand_xdata_1',
59 resource => <<__EOF__,
60 new.entry.type{XData}
61 expand.xdata =true
62 __EOF__
63 bib => <<__EOF__,
64 \@Manual{ bibtool,
65 booktitle = {The Title},
66 xdata = {x}
67 }
68 \@XData{ x,
69 title = {BibTool},
70 author = {Gerd Neugebauer}
71 }
72 __EOF__
73 expected_out => <<__EOF__,
74
75 \@Manual{ bibtool,
76 booktitle = {The Title},
77 title = {BibTool},
78 author = {Gerd Neugebauer}
79 }
80
81 __EOF__
82 expected_err => '' );
83
84 #------------------------------------------------------------------------------
85 BUnit::run(name => 'expand_xdata_2',
86 resource => <<__EOF__,
87 new.entry.type{XData}
88 expand.xdata =true
89 __EOF__
90 bib => <<__EOF__,
91 \@Manual{ bibtool,
92 title = {The Title},
93 xdata = {x}
94 }
95 \@XData{ x,
96 title = {BibTool},
97 author = {Gerd Neugebauer}
98 }
99 __EOF__
100 expected_out => <<__EOF__,
101
102 \@Manual{ bibtool,
103 title = {The Title},
104 author = {Gerd Neugebauer}
105 }
106
107 __EOF__
108 expected_err => '' );
109
110 #------------------------------------------------------------------------------
111 BUnit::run(name => 'expand_xdata_3',
112 resource => <<__EOF__,
113 new.entry.type{XData}
114 expand.xdata =true
115 __EOF__
116 bib => <<__EOF__,
117 \@Manual{ bibtool,
118 xdata = {x,y}
119 }
120 \@XData{ x,
121 title = {BibTool}
122 }
123 \@XData{ y,
124 author = {Gerd Neugebauer}
125 }
126 __EOF__
127 expected_out => <<__EOF__,
128
129 \@Manual{ bibtool,
130 title = {BibTool},
131 author = {Gerd Neugebauer}
132 }
133
134
135 __EOF__
136 expected_err => '' );
137
138 1;
139 #------------------------------------------------------------------------------
140 # Local Variables:
141 # mode: perl
142 # End: