| 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) 2015-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_line_length.t - Test suite for BibTool applying line breaking during printing. |
| 31 |
|
| 32 |
=head1 SYNOPSIS |
| 33 |
|
| 34 |
print_line_length.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 => 'print_line_length-5', |
| 59 |
args => '--print.line.length=5', |
| 60 |
expected_err => '', |
| 61 |
bib => <<__EOF__, |
| 62 |
\@Article{key, |
| 63 |
title = {x aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} |
| 64 |
} |
| 65 |
__EOF__ |
| 66 |
expected_out => <<__EOF__); |
| 67 |
|
| 68 |
\@Article{key, |
| 69 |
title={x |
| 70 |
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} |
| 71 |
} |
| 72 |
__EOF__ |
| 73 |
|
| 74 |
#------------------------------------------------------------------------------ |
| 75 |
BUnit::run(name => 'print_line_length-10-1', |
| 76 |
args => '--print.line.length=10', |
| 77 |
expected_err => '', |
| 78 |
bib => <<__EOF__, |
| 79 |
\@Article{key, |
| 80 |
title = {x aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} |
| 81 |
} |
| 82 |
__EOF__ |
| 83 |
expected_out => <<__EOF__); |
| 84 |
|
| 85 |
\@Article{ key, |
| 86 |
title ={x |
| 87 |
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} |
| 88 |
} |
| 89 |
__EOF__ |
| 90 |
|
| 91 |
#------------------------------------------------------------------------------ |
| 92 |
BUnit::run(name => 'print_line_length-10-2', |
| 93 |
args => '--print.line.length=10', |
| 94 |
expected_err => '', |
| 95 |
bib => <<__EOF__, |
| 96 |
\@Article{key, |
| 97 |
title = {x aaaaaaaaa} |
| 98 |
} |
| 99 |
__EOF__ |
| 100 |
expected_out => <<__EOF__); |
| 101 |
|
| 102 |
\@Article{ key, |
| 103 |
title ={x |
| 104 |
aaaaaaaaa} |
| 105 |
} |
| 106 |
__EOF__ |
| 107 |
|
| 108 |
#------------------------------------------------------------------------------ |
| 109 |
BUnit::run(name => 'print_line_length-10-3', |
| 110 |
args => '--print.line.length=10', |
| 111 |
expected_err => '', |
| 112 |
bib => <<__EOF__, |
| 113 |
\@Article{key, |
| 114 |
title = {x aaaaaaaaa aaaaaaaaa} |
| 115 |
} |
| 116 |
__EOF__ |
| 117 |
expected_out => <<__EOF__); |
| 118 |
|
| 119 |
\@Article{ key, |
| 120 |
title ={x |
| 121 |
aaaaaaaaa |
| 122 |
aaaaaaaaa} |
| 123 |
} |
| 124 |
__EOF__ |
| 125 |
|
| 126 |
#------------------------------------------------------------------------------ |
| 127 |
BUnit::run(name => 'print_line_length-10-4', |
| 128 |
args => '--print.line.length=10', |
| 129 |
expected_err => '', |
| 130 |
bib => <<__EOF__, |
| 131 |
\@Article{key, |
| 132 |
title = {x aaaaaaaaa aaaaaaaaa}, |
| 133 |
titlx = {x aaaaaaaaa aaaaaaaaa} |
| 134 |
} |
| 135 |
__EOF__ |
| 136 |
expected_out => <<__EOF__); |
| 137 |
|
| 138 |
\@Article{ key, |
| 139 |
title ={x |
| 140 |
aaaaaaaaa |
| 141 |
aaaaaaaaa}, |
| 142 |
titlx ={x |
| 143 |
aaaaaaaaa |
| 144 |
aaaaaaaaa} |
| 145 |
} |
| 146 |
__EOF__ |
| 147 |
|
| 148 |
#------------------------------------------------------------------------------ |
| 149 |
BUnit::run(name => 'print_line_length-20', |
| 150 |
args => '--print.line.length=20', |
| 151 |
expected_err => '', |
| 152 |
bib => <<__EOF__, |
| 153 |
\@Article{key, |
| 154 |
title = {x aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} |
| 155 |
} |
| 156 |
__EOF__ |
| 157 |
expected_out => <<__EOF__); |
| 158 |
|
| 159 |
\@Article{ key, |
| 160 |
title = {x |
| 161 |
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} |
| 162 |
} |
| 163 |
__EOF__ |
| 164 |
|
| 165 |
#------------------------------------------------------------------------------ |
| 166 |
BUnit::run(name => 'print_line_length-30', |
| 167 |
args => '--print.line.length=30', |
| 168 |
expected_err => '', |
| 169 |
bib => <<__EOF__, |
| 170 |
\@Article{key, |
| 171 |
title = {x aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} |
| 172 |
} |
| 173 |
__EOF__ |
| 174 |
expected_out => <<__EOF__); |
| 175 |
|
| 176 |
\@Article{ key, |
| 177 |
title = {x |
| 178 |
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} |
| 179 |
} |
| 180 |
__EOF__ |
| 181 |
|
| 182 |
#------------------------------------------------------------------------------ |
| 183 |
BUnit::run(name => 'print_line_length-30b', |
| 184 |
args => '--print.line.length=30', |
| 185 |
expected_err => '', |
| 186 |
bib => <<__EOF__, |
| 187 |
\@Article{key, |
| 188 |
title = {x aaaaaaaa} |
| 189 |
} |
| 190 |
__EOF__ |
| 191 |
expected_out => <<__EOF__); |
| 192 |
|
| 193 |
\@Article{ key, |
| 194 |
title = {x |
| 195 |
aaaaaaaa} |
| 196 |
} |
| 197 |
__EOF__ |
| 198 |
|
| 199 |
|
| 200 |
1; |
| 201 |
#------------------------------------------------------------------------------ |
| 202 |
# Local Variables: |
| 203 |
# mode: perl |
| 204 |
# End: |