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