Debian Codegraph @

test/fmt_name_name.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 fmt_name_name.t - Test suite for BibTool fmt.name.name.
31
32 =head1 SYNOPSIS
33
34 fmt_name_name.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 use constant BIBTEX => <<__EOF__;
58
59 \@Book{ b,
60 author = "Brinch Hansen, Per and Knuth, Donald E."
61 }
62 __EOF__
63
64
65 #------------------------------------------------------------------------------
66 BUnit::run(name => 'fmt_name_name_1',
67 resource => <<__EOF__,
68 fmt.name.name = {}
69 key.format=long
70 __EOF__
71 bib => BIBTEX,
72 expected_out => <<__EOF__,
73
74 \@Book{ brinch-hansen.pknuth.de,
75 author = "Brinch Hansen, Per and Knuth, Donald E."
76 }
77 __EOF__
78 expected_err => '');
79
80 #------------------------------------------------------------------------------
81 BUnit::run(name => 'fmt_name_name_2',
82 resource => <<__EOF__,
83 fmt.name.name = ""
84 key.format=long
85 __EOF__
86 bib => BIBTEX,
87 expected_out => <<__EOF__,
88
89 \@Book{ brinch-hansen.pknuth.de,
90 author = "Brinch Hansen, Per and Knuth, Donald E."
91 }
92 __EOF__
93 expected_err => '');
94
95 #------------------------------------------------------------------------------
96 BUnit::run(name => 'fmt_name_name_3',
97 resource => <<__EOF__,
98 fmt.name.name = " "
99 key.format=long
100 __EOF__
101 bib => BIBTEX,
102 expected_out => <<__EOF__,
103
104 \@Book{ brinch-hansen.pknuth.de,
105 author = "Brinch Hansen, Per and Knuth, Donald E."
106 }
107 __EOF__
108 expected_err => '');
109
110 #------------------------------------------------------------------------------
111 BUnit::run(name => 'fmt_name_name_4',
112 resource => <<__EOF__,
113 fmt.name.name = " -- "
114 key.format=long
115 __EOF__
116 bib => BIBTEX,
117 expected_out => <<__EOF__,
118
119 \@Book{ brinch-hansen.p--knuth.de,
120 author = "Brinch Hansen, Per and Knuth, Donald E."
121 }
122 __EOF__
123 expected_err => '');
124
125 #------------------------------------------------------------------------------
126 BUnit::run(name => 'fmt_name_name_5',
127 resource => <<__EOF__,
128 fmt.name.name = " -- xx "
129 key.format=long
130 __EOF__
131 bib => BIBTEX,
132 expected_out => <<__EOF__,
133
134 \@Book{ brinch-hansen.p--knuth.de,
135 author = "Brinch Hansen, Per and Knuth, Donald E."
136 }
137 __EOF__
138 expected_err => '');
139
140 1;
141 #------------------------------------------------------------------------------
142 # Local Variables:
143 # mode: perl
144 # End: