This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
update to Text::Wrap 98.112901 from David Muir Sharnoff
[perl5.git] / t / lib / textfill.t
CommitLineData
0c5a43b5
GS
1#!/usr/bin/perl -w -I.
2
3@tests = (split(/\nEND\n/s, <<DONE));
4TEST1
5Cyberdog Information
6
7Cyberdog & Netscape in the news
8Important Press Release regarding Cyberdog and Netscape. Check it out!
9
10Cyberdog Plug-in Support!
11Cyberdog support for Netscape Plug-ins is now available to download! Go
12to the Cyberdog Beta Download page and download it now!
13
14Cyberdog Book
15Check out Jesse Feiler's way-cool book about Cyberdog. You can find
16details out about the book as well as ordering information at Philmont
17Software Mill site.
18
19Java!
20Looking to view Java applets in Cyberdog 1.1 Beta 3? Download and install
21the Mac OS Runtime for Java and try it out!
22
23Cyberdog 1.1 Beta 3
24We hope that Cyberdog and OpenDoc 1.1 will be available within the next
25two weeks. In the meantime, we have released another version of
26Cyberdog, Cyberdog 1.1 Beta 3. This version fixes several bugs that were
27reported to us during out public beta period. You can check out our release
28notes to see what we fixed!
29END
30 Cyberdog Information
31 Cyberdog & Netscape in the news Important Press Release regarding
32 Cyberdog and Netscape. Check it out!
33 Cyberdog Plug-in Support! Cyberdog support for Netscape Plug-ins is now
34 available to download! Go to the Cyberdog Beta Download page and download
35 it now!
36 Cyberdog Book Check out Jesse Feiler's way-cool book about Cyberdog.
37 You can find details out about the book as well as ordering information at
38 Philmont Software Mill site.
39 Java! Looking to view Java applets in Cyberdog 1.1 Beta 3? Download and
40 install the Mac OS Runtime for Java and try it out!
41 Cyberdog 1.1 Beta 3 We hope that Cyberdog and OpenDoc 1.1 will be
42 available within the next two weeks. In the meantime, we have released
43 another version of Cyberdog, Cyberdog 1.1 Beta 3. This version fixes
44 several bugs that were reported to us during out public beta period. You
45 can check out our release notes to see what we fixed!
46END
47DONE
48
49
50$| = 1;
51
52print "1..";
53print @tests/2;
54print "\n";
55
56use Text::Wrap;
57
58$rerun = $ENV{'PERL_DL_NONLAZY'} ? 0 : 1;
59
60$tn = 1;
61while (@tests) {
62 my $in = shift(@tests);
63 my $out = shift(@tests);
64
65 $in =~ s/^TEST(\d+)?\n//;
66
67 my $back = fill(' ', ' ', $in);
68
69 if ($back eq $out) {
70 print "ok $tn\n";
71 } elsif ($rerun) {
72 my $oi = $in;
73 require File::Slurp;
74 File::Slurp::write_file("#o", $back);
75 File::Slurp::write_file("#e", $out);
76 foreach ($in, $back, $out) {
77 s/\t/^I\t/gs;
78 s/\n/\$\n/gs;
79 }
80 print "------------ input ------------\n";
81 print $in;
82 print "\n------------ output -----------\n";
83 print $back;
84 print "\n------------ expected ---------\n";
85 print $out;
86 print "\n-------------------------------\n";
87 $Text::Wrap::debug = 1;
88 fill(' ', ' ', $oi);
89 exit(1);
90 } else {
91 print "not ok $tn\n";
92 }
93 $tn++;
94}