-
+#!./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
"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
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
-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");