diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-01-19 11:36:30 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-01-21 08:36:52 +0000 |
commit | 3842ad601c6b8e31f3a5b94a079521878abadffd (patch) | |
tree | 59fc2c5351541a500512f3e138af7175d55d572f /lib/Pod | |
parent | 3bef022b1cf74e180ad95e473e0ef94a3d7c4fe2 (diff) | |
download | perl-3842ad601c6b8e31f3a5b94a079521878abadffd.tar.gz |
Convert lib/Pod/t/utils.t from Test to Test::More
Curiously this test file is not part of the Pod-Parser distribution.
Diffstat (limited to 'lib/Pod')
-rw-r--r-- | lib/Pod/t/utils.t | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/lib/Pod/t/utils.t b/lib/Pod/t/utils.t index 4a1b8a14b9..9f4fe55f00 100644 --- a/lib/Pod/t/utils.t +++ b/lib/Pod/t/utils.t @@ -1,18 +1,11 @@ - +#!./perl -w # Test hyperlinks et al from Pod::ParseUtils -BEGIN { - chdir 't' if -d 't'; - @INC = '../lib'; - require Test; import Test; - plan(tests => 22); -} +use Test::More tests => 22; use strict; use Pod::ParseUtils; -# First test the hyperlinks - my @links = qw{ name name/ident @@ -39,11 +32,11 @@ my @results = ( "Q<text>", ); -ok(@results,@links); +is(@results, @links, 'sanity check - array lengths equal?'); for my $i( 0..@links ) { my $link = new Pod::Hyperlink( $links[$i] ); - ok($link->markup, $results[$i]); + is($link->markup, $results[$i], "test hyperlink $i"); } # Now test lists @@ -56,9 +49,9 @@ my $list = new Pod::List( -indent => 4, ok($list); -ok($list->indent, 4); -ok($list->start, 52); -ok($list->type, "OL"); +is($list->indent, 4); +is($list->start, 52); +is($list->type, "OL"); # Pod::Cache @@ -74,19 +67,15 @@ $cache->item( -file => "file.t", ); -# Now look for an item of this name my $item = $cache->find_page("Pod::ParseUtils"); -ok($item); +ok($item, 'found item of this name'); -# and a failure -ok($cache->find_page("Junk"), undef); +is($cache->find_page("Junk"), undef, 'expect to find nothing'); -# Make sure that the item we found is the same one as the -# first in the list my @i = $cache->item; -ok($i[0], $item); +is($i[0], $item, 'item we found is the same one as the first in the list'); # Check the contents -ok($item->page, "Pod::ParseUtils"); -ok($item->description, "A description"); -ok($item->file, "file.t"); +is($item->page, "Pod::ParseUtils"); +is($item->description, "A description"); +is($item->file, "file.t"); |