X-Git-Url: https://git.donarmstrong.com/?p=term-progressbar.git;a=blobdiff_plain;f=t%2Fcompat.t;fp=t%2Fcompat.t;h=3698e57aa88747db68e22b82455cdda21ca3df76;hp=daba215626f1c3c3a78abc918112ec4bb9539954;hb=8f87af0520c5dbcedbfe74dd6ef6e7826f200263;hpb=7966daddf59dcdf39b4ba3a6aa33424624c81d7e diff --git a/t/compat.t b/t/compat.t index daba215..3698e57 100644 --- a/t/compat.t +++ b/t/compat.t @@ -12,15 +12,7 @@ and is intended to test compatibility with that version. # Utility ----------------------------- use Data::Dumper qw( ); -use Test qw( ok plan ); - -# Test Setup -------------------------- - -BEGIN { - plan tests => 5, - todo => [], - ; -} +use Test::More tests => 4; # ------------------------------------- @@ -68,23 +60,9 @@ sub grab_output($) { return [ $o, $e ]; } -# Change 1..1 below to 1..last_test_to_print . -# (It may become useful if the test is moved to ./t subdirectory.) - use Term::ProgressBar; use POSIX qw; -=head2 Test 1: compilation - -This test confirms that the test script and the modules it calls compiled -successfully. - -=cut - -ok 1, 1, 'compilation'; - -# ------------------------------------- - $| = 1; my $count = 100; @@ -99,7 +77,7 @@ if (not $b or $o->[0] ne '' or $o->[1] ne "$test_str: ") { if $ENV{TEST_DEBUG}; print 'not '; } -print "ok 2\n"; +ok 1; # Test 3: do half the stuff and check half the bar has printed my $halfway = floor($count / 2); @@ -111,7 +89,7 @@ if ($o->[0] ne '' if $ENV{TEST_DEBUG}; print 'not '; } -print "ok 3\n"; +ok 1; # Test 4: do the rest of the stuff and check the whole bar has printed $o = grab_output("update \$b foreach ($halfway .. $count - 1)"); @@ -122,7 +100,7 @@ if ($o->[0] ne '' if $ENV{TEST_DEBUG}; print 'not '; } -print "ok 4\n"; +ok 1; # Test 5: try to do another item and check there is an error eval { update $b }; @@ -134,4 +112,4 @@ unless ( defined($@) if $ENV{TEST_DEBUG}; print 'not '; } -print "ok 5\n"; +ok 1;