Debian Codegraph @

test/print_newline.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 print_newline.t - Test suite for BibTool print.newline.
31
32 =head1 SYNOPSIS
33
34 print_newline.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 => 'print_newline_1',
60 args => '-- print.newline=0 bib/x1.bib bib/x1.bib',
61 expected_out => "\n".
62 "\@Manual{ bibtool,\n".
63 " title = {BibTool},\n".
64 " author = {Gerd Neugebauer},\n".
65 " year = 2018\n".
66 "}\n".
67 "\@Manual{ bibtool,\n".
68 " title = {BibTool},\n".
69 " author = {Gerd Neugebauer},\n".
70 " year = 2018\n".
71 "}",
72 expected_err => ''
73 );
74
75 #------------------------------------------------------------------------------
76 BUnit::run(name => 'print_newline_2',
77 args => '-- print.newline=1 bib/x1.bib bib/x1.bib',
78 expected_out => <<__EOF__,
79
80 \@Manual{ bibtool,
81 title = {BibTool},
82 author = {Gerd Neugebauer},
83 year = 2018
84 }
85
86 \@Manual{ bibtool,
87 title = {BibTool},
88 author = {Gerd Neugebauer},
89 year = 2018
90 }
91 __EOF__
92 expected_err => ''
93 );
94
95 #------------------------------------------------------------------------------
96 BUnit::run(name => 'print_newline_3',
97 args => '-- print.newline=2 bib/x1.bib bib/x1.bib',
98 expected_out => <<__EOF__,
99
100 \@Manual{ bibtool,
101 title = {BibTool},
102 author = {Gerd Neugebauer},
103 year = 2018
104 }
105
106
107 \@Manual{ bibtool,
108 title = {BibTool},
109 author = {Gerd Neugebauer},
110 year = 2018
111 }
112
113 __EOF__
114 expected_err => ''
115 );
116
117 #------------------------------------------------------------------------------
118 # Local Variables:
119 # mode: perl
120 # End: