Update docs and English.pm for $^C
[p5sagit/p5-mst-13.2.git] / t / lib / textwrap.t
CommitLineData
1a3850a5 1#!./perl
2
3BEGIN {
4 chdir 't' if -d 't';
5 @INC = '../lib';
6}
7
8print "1..5\n";
9
10use Text::Wrap qw(wrap $columns);
11
12$columns = 30;
13
14$text = <<'EOT';
15Text::Wrap is a very simple paragraph formatter. It formats a
16single paragraph at a time by breaking lines at word boundries.
17Indentation is controlled for the first line ($initial_tab) and
18all subsquent lines ($subsequent_tab) independently. $Text::Wrap::columns
19should be set to the full width of your output device.
20EOT
21
22$text =~ s/\n/ /g;
23$_ = wrap "| ", "|", $text;
24
25#print "$_\n";
26
27print "not " unless /^\| Text::Wrap is/; # start is ok
28print "ok 1\n";
29
30print "not " if /^.{31,}$/m; # no line longer than 30 chars
31print "ok 2\n";
32
33print "not " unless /^\|\w/m; # other lines start with
34print "ok 3\n";
35
36print "not " unless /\bsubsquent\b/; # look for a random word
37print "ok 4\n";
38
39print "not " unless /\bdevice\./; # look for last word
40print "ok 5\n";