diff options
author | Mark Murray <markm@FreeBSD.org> | 1998-09-09 07:00:04 +0000 |
---|---|---|
committer | Mark Murray <markm@FreeBSD.org> | 1998-09-09 07:00:04 +0000 |
commit | ff6b7ba98e8d4aab04cbe2bfdffdfc9171c1812b (patch) | |
tree | 58b20e81687d6d5931f120b50802ed21225bf440 /contrib/perl5/t/lib/textwrap.t |
Initial import of Perl5. The king is dead; long live the king!vendor/perl5/5.005.02
Notes
Notes:
svn path=/vendor/perl5/dist/; revision=38980
svn path=/vendor/perl5/5.005.02/; revision=38982; tag=vendor/perl5/5.005.02
Diffstat (limited to 'contrib/perl5/t/lib/textwrap.t')
-rwxr-xr-x | contrib/perl5/t/lib/textwrap.t | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/contrib/perl5/t/lib/textwrap.t b/contrib/perl5/t/lib/textwrap.t new file mode 100755 index 000000000000..9c8d1b497569 --- /dev/null +++ b/contrib/perl5/t/lib/textwrap.t @@ -0,0 +1,40 @@ +#!./perl + +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +print "1..5\n"; + +use Text::Wrap qw(wrap $columns); + +$columns = 30; + +$text = <<'EOT'; +Text::Wrap is a very simple paragraph formatter. It formats a +single paragraph at a time by breaking lines at word boundries. +Indentation is controlled for the first line ($initial_tab) and +all subsquent lines ($subsequent_tab) independently. $Text::Wrap::columns +should be set to the full width of your output device. +EOT + +$text =~ s/\n/ /g; +$_ = wrap "| ", "|", $text; + +#print "$_\n"; + +print "not " unless /^\| Text::Wrap is/; # start is ok +print "ok 1\n"; + +print "not " if /^.{31,}$/m; # no line longer than 30 chars +print "ok 2\n"; + +print "not " unless /^\|\w/m; # other lines start with +print "ok 3\n"; + +print "not " unless /\bsubsquent\b/; # look for a random word +print "ok 4\n"; + +print "not " unless /\bdevice\./; # look for last word +print "ok 5\n"; |