Skip to content

Commit

Permalink
less verbose, trimmed empty tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mwarin committed Sep 5, 2024
1 parent 5e1a786 commit 29d0588
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions t/enqueue.t
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,23 @@ describe "bin/enqueue.pl" => sub {
my $cmd = shift;
my $match_rx = shift;
my $expect_match_count = shift;
my $verbose = shift || 0;

my $full_cmd = "perl bin/enqueue.pl $cmd";
my (undef, undef, $line) = caller;
print "Check output from command on line $line [$full_cmd] against rx [$match_rx]\n";
print "Check output from command on line $line [$full_cmd] against rx [$match_rx]\n" if $verbose;

# Run command, capture output.
# Use double spaces to make it look good.
my @cmd_output = `$full_cmd`;
my $double_space = " ";
print "Output:[\n$double_space" . join($double_space, @cmd_output) . "]\n";
print "Output:[\n$double_space" . join($double_space, @cmd_output) . "]\n" if $verbose;

# Check that the desired regex was found in the output
my $match_count = grep {$_ =~ $match_rx} @cmd_output;
print "Expected $match_rx match count: $expect_match_count, got $match_count\n";
print "Expected $match_rx match count: $expect_match_count, got $match_count\n" if $verbose;
ok($match_count == $expect_match_count);
print "\n";
print "\n" if $verbose;
}

before each => sub {
Expand Down Expand Up @@ -143,7 +144,6 @@ describe "bin/enqueue.pl" => sub {
1
);
};

it "uses -u to reuse punted items rather than re-download" => sub {
fake_bibdata(testvolume);
enqueue_testvolume(status => 'punted');
Expand Down Expand Up @@ -181,20 +181,6 @@ describe "bin/enqueue.pl" => sub {
# clean up
system("rm -f /tmp/prep/toingest/test/test.zip /tmp/prep/failed/test/test.zip");
};
it "" => sub {
};
it "" => sub {
};
it "" => sub {
};
it "" => sub {
};
it "" => sub {
};
it "" => sub {
};
it "" => sub {
};
};

runtests unless caller;

0 comments on commit 29d0588

Please sign in to comment.