]> git.vpit.fr Git - perl/modules/rgit.git/blobdiff - t/20-each.t
Improve tests granularity
[perl/modules/rgit.git] / t / 20-each.t
index 4180a933335cbc58702aa957440ea7cd4b656a32..1c582464dcd9a9b566e66a2a0abd95b15b4ebf0a 100644 (file)
@@ -7,7 +7,7 @@ use Cwd qw/cwd abs_path/;
 use File::Spec::Functions qw/catdir catfile/;
 use File::Temp qw/tempfile tempdir/;
 
-use Test::More tests => 2 + 3 * 2;
+use Test::More tests => 2 + 2 * 2 + 11 * (3 + 1);
 
 use App::Rgit;
 
@@ -106,5 +106,15 @@ for my $cmd (qw/commit FAIL/) {
  my @lines = split /\n/, do { local $/; <$fh> };
  my $res = [ map [ split /\|/, $_ ], @lines ];
  my $exp = [ map [ $cmd, @$_ ], $fail ? $expected[0] : @expected ];
- is_deeply($res, $exp, "each $cmd did the right thing");
+ for my $i (0 .. $#$exp) {
+  my $e = $exp->[$i];
+  my $r = shift @$res;
+  isnt($r, undef, "each $cmd visited repository $i");
+SKIP:
+  {
+   skip 'didn\'t visited that repo' => 10 unless defined $r;
+   is($r->[$_], $e->[$_], "each $cmd argument $_ for repository $i is ok")
+    for 0 .. 9;
+  }
+ }
 }