diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-10-27 22:15:02 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-10-27 22:15:02 +0000 |
commit | 3ccb20c38f7c76ca6cf40b6f3635865cd787e0c0 (patch) | |
tree | f795002d81e9d7d50229d94e6a5e56fad2742036 | |
parent | 8d8e7152f5c08aa246a156bc0aa44d6d9f81271c (diff) |
stock perl 5.8.0 from CPAN
-rw-r--r-- | gnu/usr.bin/perl/lib/FindBin.t | 15 | ||||
-rw-r--r-- | gnu/usr.bin/perl/lib/Pod/t/InputObjects.t | 4 | ||||
-rw-r--r-- | gnu/usr.bin/perl/lib/Pod/t/utils.t | 47 |
3 files changed, 38 insertions, 28 deletions
diff --git a/gnu/usr.bin/perl/lib/FindBin.t b/gnu/usr.bin/perl/lib/FindBin.t index 36e142c476e..80ac811d208 100644 --- a/gnu/usr.bin/perl/lib/FindBin.t +++ b/gnu/usr.bin/perl/lib/FindBin.t @@ -5,16 +5,15 @@ BEGIN { @INC = -d 't' ? 'lib' : '../lib'; } -print "1..2\n"; +print "1..1\n"; use FindBin qw($Bin); print "# $Bin\n"; -print "not " unless $Bin =~ m,[/.]lib\]?$,; -print "ok 1\n"; - -$0 = "-"; -FindBin::again(); -print "not " if $FindBin::Script ne "-"; -print "ok 2\n"; +if ($^O eq 'MacOS') { + print "not " unless $Bin =~ m,:lib:$,; +} else { + print "not " unless $Bin =~ m,[/.]lib\]?$,; +} +print "ok 1\n"; diff --git a/gnu/usr.bin/perl/lib/Pod/t/InputObjects.t b/gnu/usr.bin/perl/lib/Pod/t/InputObjects.t index 515645a43bf..d0860864774 100644 --- a/gnu/usr.bin/perl/lib/Pod/t/InputObjects.t +++ b/gnu/usr.bin/perl/lib/Pod/t/InputObjects.t @@ -31,13 +31,13 @@ use_ok( 'Pod::InputObjects' ); { # test package Pod::Paragraph my $p_p1 = Pod::Paragraph->new( -text => 'NAME', -name => 'head2' ); my $p_p2 = Pod::Paragraph->new( 'test - This is the test suite' ); - isa_ok( $p_p1, 'Pod::Paragraph', 'Pod::Paragraph constructor' ); + isa_ok( $p_p1, 'Pod::Paragraph', 'Pod::Paragraph constuctor' ); isa_ok( $p_p2, 'Pod::Paragraph', 'Pod::Paragraph constructor revisited' ); is( $p_p1->cmd_name(), 'head2', 'Pod::Paragraph->cmd_name()' ); is( $p_p1->cmd_name( 'head1' ), 'head1', 'Pod::Paragraph->cmd_name( head1 )' ); - ok( !$p_p2->cmd_name(), + cmp_ok( $p_p2->cmd_name(), 'eq', '', 'Pod::Paragraph->cmd_name() revisited' ); is( $p_p1->text(), 'NAME', 'Pod::Paragraph->text()' ); diff --git a/gnu/usr.bin/perl/lib/Pod/t/utils.t b/gnu/usr.bin/perl/lib/Pod/t/utils.t index 9f4fe55f004..202ffd95105 100644 --- a/gnu/usr.bin/perl/lib/Pod/t/utils.t +++ b/gnu/usr.bin/perl/lib/Pod/t/utils.t @@ -1,11 +1,18 @@ -#!./perl -w + # Test hyperlinks et al from Pod::ParseUtils -use Test::More tests => 22; +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; + require Test; import Test; + plan(tests => 22); +} use strict; use Pod::ParseUtils; +# First test the hyperlinks + my @links = qw{ name name/ident @@ -20,11 +27,11 @@ my @links = qw{ }; my @results = ( - "P<name>", - "Q<ident> in P<name>", - "Q<sec> in P<name>", - "Q<sec>", - "Q<sec>", + "the P<name> manpage", + "the Q<ident> entry in the P<name> manpage", + "the section on Q<sec> in the P<name> manpage", + "the section on Q<sec> elsewhere in this document", + "the section on Q<sec> elsewhere in this document", "Q<http://www.perl.org/>", "Q<text>", "Q<text>", @@ -32,11 +39,11 @@ my @results = ( "Q<text>", ); -is(@results, @links, 'sanity check - array lengths equal?'); +ok(@results,@links); for my $i( 0..@links ) { my $link = new Pod::Hyperlink( $links[$i] ); - is($link->markup, $results[$i], "test hyperlink $i"); + ok($link->markup, $results[$i]); } # Now test lists @@ -49,9 +56,9 @@ my $list = new Pod::List( -indent => 4, ok($list); -is($list->indent, 4); -is($list->start, 52); -is($list->type, "OL"); +ok($list->indent, 4); +ok($list->start, 52); +ok($list->type, "OL"); # Pod::Cache @@ -67,15 +74,19 @@ $cache->item( -file => "file.t", ); +# Now look for an item of this name my $item = $cache->find_page("Pod::ParseUtils"); -ok($item, 'found item of this name'); +ok($item); -is($cache->find_page("Junk"), undef, 'expect to find nothing'); +# and a failure +ok($cache->find_page("Junk"), undef); +# Make sure that the item we found is the same one as the +# first in the list my @i = $cache->item; -is($i[0], $item, 'item we found is the same one as the first in the list'); +ok($i[0], $item); # Check the contents -is($item->page, "Pod::ParseUtils"); -is($item->description, "A description"); -is($item->file, "file.t"); +ok($item->page, "Pod::ParseUtils"); +ok($item->description, "A description"); +ok($item->file, "file.t"); |