3 @tests = (split(/\nEND\n/s, <<DONE));
13 This is a test of a very long line. It should be broken up and put onto multiple lines.
14 This is a test of a very long line. It should be broken up and put onto multiple lines.
16 This is a test of a very long line. It should be broken up and put onto multiple lines.
18 This is a test of a very long line. It should be broken up and put onto= multiple lines.= This is a test of a very long line. It should be broken up and put onto= multiple lines.= = This is a test of a very long line. It should be broken up and put onto= multiple lines.
21 This is a test of a very long line. It should be broken up and put onto multiple lines.
23 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 multiple lines.
29 This is a test of a very long line. It should be broken up and put onto= multiple lines.
33 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
35 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
38 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
40 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
43 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
45 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
48 A test of a very very long word.
49 a123456789b123456789c123456789d123456789e123456789f123456789g123456789g1234567
51 A test of a very very long word.= a123456789b123456789c123456789d123456789e123456789f123456789g123456789g123= 4567
54 A test of a very very long word. a123456789b123456789c123456789d123456789e123456789f123456789g123456789g1234567
56 A test of a very very long word. = a123456789b123456789c123456789d123456789e123456789f123456789g123456789g123= 4567
60 "never eat paste my darling"
63 my mother once said= "never eat paste my darling"= would that I heeded
66 This_is_a_word_that_is_too_long_to_wrap_we_want_to_make_sure_that_the_program_does_not_crash_and_burn
68 This_is_a_word_that_is_too_long_to_wrap_we_want_to_make_sure_that_the_pr= ogram_does_not_crash_and_burn
80 This= = Has= = Blank= = Lines
88 print "1..", 1 +@tests, "\n";
91 $Text::Wrap::separator = '=';
93 $rerun = $ENV{'PERL_DL_NONLAZY'} ? 0 : 1;
100 my $out = shift(@st);
102 $in =~ s/^TEST(\d+)?\n//;
104 my $back = wrap(' ', ' ', $in);
110 foreach ($in, $back, $out) {
114 print "------------ input ------------\n";
116 print "\n------------ output -----------\n";
118 print "\n------------ expected ---------\n";
120 print "\n-------------------------------\n";
121 $Text::Wrap::debug = 1;
125 print "not ok $tn\n";
134 my $out = shift(@st);
136 $in =~ s/^TEST(\d+)?\n//;
138 my @in = split("\n", $in, -1);
139 @in = ((map { "$_\n" } @in[0..$#in-1]), $in[-1]);
141 my $back = wrap(' ', ' ', @in);
147 foreach ($in, $back, $out) {
151 print "------------ input2 ------------\n";
153 print "\n------------ output2 -----------\n";
155 print "\n------------ expected2 ---------\n";
157 print "\n-------------------------------\n";
158 $Text::Wrap::debug = 1;
162 print "not ok $tn\n";
167 $Text::Wrap::huge = 'overflow';
169 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';
170 my $w = wrap('zzz','yyy',$tw);
171 print (($w eq "zzz$tw") ? "ok $tn\n" : "not ok $tn");