From 3842ad601c6b8e31f3a5b94a079521878abadffd Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Wed, 19 Jan 2011 11:36:30 +0000 Subject: [PATCH] Convert lib/Pod/t/utils.t from Test to Test::More Curiously this test file is not part of the Pod-Parser distribution. --- lib/Pod/t/utils.t | 37 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/lib/Pod/t/utils.t b/lib/Pod/t/utils.t index 4a1b8a1..9f4fe55 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", ); -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"); -- 2.7.4