| 1 | #!/usr/bin/perl -w
|
|---|
| 2 | # $Id: text-errors.t,v 1.1 2002/01/01 02:41:53 eagle Exp $
|
|---|
| 3 | #
|
|---|
| 4 | # texterrs.t -- Error tests for Pod::Text.
|
|---|
| 5 | #
|
|---|
| 6 | # Copyright 2001 by Russ Allbery <[email protected]>
|
|---|
| 7 | #
|
|---|
| 8 | # This program is free software; you may redistribute it and/or modify it
|
|---|
| 9 | # under the same terms as Perl itself.
|
|---|
| 10 |
|
|---|
| 11 | BEGIN {
|
|---|
| 12 | chdir 't' if -d 't';
|
|---|
| 13 | if ($ENV{PERL_CORE}) {
|
|---|
| 14 | @INC = '../lib';
|
|---|
| 15 | } else {
|
|---|
| 16 | unshift (@INC, '../blib/lib');
|
|---|
| 17 | }
|
|---|
| 18 | unshift (@INC, '../blib/lib');
|
|---|
| 19 | $| = 1;
|
|---|
| 20 | print "1..5\n";
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 | END {
|
|---|
| 24 | print "not ok 1\n" unless $loaded;
|
|---|
| 25 | }
|
|---|
| 26 |
|
|---|
| 27 | use Pod::Text;
|
|---|
| 28 |
|
|---|
| 29 | $loaded = 1;
|
|---|
| 30 | print "ok 1\n";
|
|---|
| 31 |
|
|---|
| 32 | # Hard-code a few values to try to get reproducible results.
|
|---|
| 33 | $ENV{COLUMNS} = 80;
|
|---|
| 34 | $ENV{TERM} = 'xterm';
|
|---|
| 35 | $ENV{TERMCAP} = 'xterm:co=80:do=^J:md=\E[1m:us=\E[4m:me=\E[m';
|
|---|
| 36 |
|
|---|
| 37 | # Set default options to match those of pod2man and pod2text.
|
|---|
| 38 | my %options = (sentence => 0);
|
|---|
| 39 |
|
|---|
| 40 | # Capture warnings for inspection.
|
|---|
| 41 | my $warnings = '';
|
|---|
| 42 | $SIG{__WARN__} = sub { $warnings .= $_[0] };
|
|---|
| 43 |
|
|---|
| 44 | # Run a single test, given some POD to parse and the warning messages that are
|
|---|
|
|---|