]> git.vpit.fr Git - perl/modules/rgit.git/blobdiff - t/20-each.t
Check the value returned by git correctly. POSIX is now a dependency
[perl/modules/rgit.git] / t / 20-each.t
index 4180a933335cbc58702aa957440ea7cd4b656a32..ca87e8a0aa373134f1e3af9a54480adfaaf96ae1 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;
 
@@ -102,9 +102,19 @@ for my $cmd (qw/commit FAIL/) {
  isnt($ar, undef, "each $cmd has a defined object");
  my $exit = $ar->run;
  my $fail = $cmd eq 'FAIL' ? 1 : 0;
- is($exit, $fail << 8, "each $cmd returned $fail");
+ is($exit, $fail, "each $cmd returned $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;
+  }
+ }
 }