8 @tests = (split(/\nEND\n/s, <<DONE));
21 This is a test of a very long line. It should be broken up and put onto multiple lines.
22 This is a test of a very long line. It should be broken up and put onto multiple lines.
24 This is a test of a very long line. It should be broken up and put onto multiple lines.
26 This is a test of a very long line. It should be broken up and put onto
28 This is a test of a very long line. It should be broken up and put onto
31 This is a test of a very long line. It should be broken up and put onto
35 This is a test of a very long line. It should be broken up and put onto multiple lines.
37 This is a test of a very long line. It should be broken up and put onto
41 This is a test of a very long line. It should be broken up and put onto multiple lines.
44 This is a test of a very long line. It should be broken up and put onto
49 This is a test of a very long line. It should be broken up and put onto multiple This is a test of a very long line. It should be broken up and put
51 This is a test of a very long line. It should be broken up and put onto
52 multiple This is a test of a very long line. It should be broken up and
56 11111111 22222222 33333333 44444444 55555555 66666666 77777777 888888888 999999999 aaaaaaaaa bbbbbbbbb ccccccccc ddddddddd eeeeeeeee ffffffff gggggggg hhhhhhhh iiiiiiii jjjjjjjj kkkkkkkk llllllll mmmmmmmmm nnnnnnnnn ooooooooo ppppppppp qqqqqqqqq rrrrrrrrr sssssssss
58 11111111 22222222 33333333 44444444 55555555 66666666 77777777 888888888
59 999999999 aaaaaaaaa bbbbbbbbb ccccccccc ddddddddd eeeeeeeee ffffffff
60 gggggggg hhhhhhhh iiiiiiii jjjjjjjj kkkkkkkk llllllll mmmmmmmmm nnnnnnnnn
61 ooooooooo ppppppppp qqqqqqqqq rrrrrrrrr sssssssss
64 c3t1d0s6 c4t1d0s6 c5t1d0s6 c6t1d0s6 c7t1d0s6 c8t1d0s6 c9t1d0s6 c10t1d0s6 c11t1d0s6 c12t1d0s6 c13t1d0s6 c14t1d0s6 c15t1d0s6 c16t1d0s6 c3t1d0s0 c4t1d0s0 c5t1d0s0 c6t1d0s0 c7t1d0s0 c8t1d0s0 c9t1d0s0 c10t1d0s0 c11t1d0s0 c12t1d0s0 c13t1d0s0 c14t1d0s0 c15t1d0s0 c16t1d0s0
66 c3t1d0s6 c4t1d0s6 c5t1d0s6 c6t1d0s6 c7t1d0s6 c8t1d0s6 c9t1d0s6 c10t1d0s6
67 c11t1d0s6 c12t1d0s6 c13t1d0s6 c14t1d0s6 c15t1d0s6 c16t1d0s6 c3t1d0s0
68 c4t1d0s0 c5t1d0s0 c6t1d0s0 c7t1d0s0 c8t1d0s0 c9t1d0s0 c10t1d0s0 c11t1d0s0
69 c12t1d0s0 c13t1d0s0 c14t1d0s0 c15t1d0s0 c16t1d0s0
72 A test of a very very long word.
73 a123456789b123456789c123456789d123456789e123456789f123456789g123456789g1234567
75 A test of a very very long word.
76 a123456789b123456789c123456789d123456789e123456789f123456789g123456789g123
80 A test of a very very long word. a123456789b123456789c123456789d123456789e123456789f123456789g123456789g1234567
82 A test of a very very long word.
83 a123456789b123456789c123456789d123456789e123456789f123456789g123456789g123
88 "never eat paste my darling"
92 "never eat paste my darling"
96 This_is_a_word_that_is_too_long_to_wrap_we_want_to_make_sure_that_the_program_does_not_crash_and_burn
98 This_is_a_word_that_is_too_long_to_wrap_we_want_to_make_sure_that_the_pr
99 ogram_does_not_crash_and_burn
125 print "1..", 1 +@tests, "\n";
129 $rerun = $ENV{'PERL_DL_NONLAZY'} ? 0 : 1;
136 my $out = shift(@st);
138 $in =~ s/^TEST(\d+)?\n//;
140 my $back = wrap(' ', ' ', $in);
146 foreach ($in, $back, $out) {
150 print "------------ input ------------\n";
152 print "\n------------ output -----------\n";
154 print "\n------------ expected ---------\n";
156 print "\n-------------------------------\n";
157 $Text::Wrap::debug = 1;
161 print "not ok $tn\n";
170 my $out = shift(@st);
172 $in =~ s/^TEST(\d+)?\n//;
174 my @in = split("\n", $in, -1);
175 @in = ((map { "$_\n" } @in[0..$#in-1]), $in[-1]);
177 my $back = wrap(' ', ' ', @in);
183 foreach ($in, $back, $out) {
187 print "------------ input2 ------------\n";
189 print "\n------------ output2 -----------\n";
191 print "\n------------ expected2 ---------\n";
193 print "\n-------------------------------\n";
194 $Text::Wrap::debug = 1;
198 print "not ok $tn\n";
203 $Text::Wrap::huge = 'overflow';
205 my $tw = 'This_is_a_word_that_is_too_long_to_wrap_we_want_to_make_sure_that_the_program_does_not_crash_and_burn';
206 my $w = wrap('zzz','yyy',$tw);
207 print (($w eq "zzz$tw") ? "ok $tn\n" : "not ok $tn");