]> git.donarmstrong.com Git - term-progressbar.git/blobdiff - t/v2-mobile.t
switch from Test to Test::More
[term-progressbar.git] / t / v2-mobile.t
index dca40621682c94ed8f55849f35c29b9283a6f713..5021f2d6f3a4cd20e218a3d3f8f933fd6f5dc62b 100644 (file)
@@ -10,29 +10,14 @@ This package tests the moving target functionality of Term::ProgressBar.
 
 use Data::Dumper qw( Dumper );
 use FindBin      qw( $Bin );
-use Test         qw( ok plan );
+use Test::More tests => 7;
 
 use lib $Bin;
 use test qw( evcheck );
 
 use Capture::Tiny qw(capture);
 
-BEGIN {
-  # 1 for compilation test,
-  plan tests  => 7,
-       todo   => [],
-}
-
-=head2 Test 1: compilation
-
-This test confirms that the test script and the modules it calls compiled
-successfully.
-
-=cut
-
-use Term::ProgressBar;
-
-ok 1, 1, 'compilation';
+use_ok 'Term::ProgressBar';
 
 Term::ProgressBar->__force_term (50);
 
@@ -57,13 +42,13 @@ Update it from 11 to 20.
 my ($out, $err) = capture {
   my $p;
   ok (evcheck(sub { $p = Term::ProgressBar->new(10); }, 'Count 1-20 (1)' ),
-      1, 'Count 1-20 (1)');
+      'Count 1-20 (1)');
   ok (evcheck(sub { $p->update($_) for 1..5  },  'Count 1-20 (2)' ),
-      1, 'Count 1-20 (2)');
+      'Count 1-20 (2)');
   ok (evcheck(sub { $p->target(20)    },         'Count 1-20 (3)' ),
-      1, 'Count 1-20 (3)');
+      'Count 1-20 (3)');
   ok (evcheck(sub { $p->update($_) for 11..20 }, 'Count 1-20 (4)' ),
-      1, 'Count 1-20 (4)');
+      'Count 1-20 (4)');
 };
 print $out;
 
@@ -73,5 +58,5 @@ print $out;
 
   my @lines = split /\n/, $err;
 
-  ok $lines[-1], qr/\[=+\]/,            'Count 1-20 (5)';
-  ok $lines[-1], qr/^\s*100%/,          'Count 1-20 (6)';
+  like $lines[-1], qr/\[=+\]/,            'Count 1-20 (5)';
+  like $lines[-1], qr/^\s*100%/,          'Count 1-20 (6)';