Skip to content

Commit

Permalink
Hoist tests into single test
Browse files Browse the repository at this point in the history
  • Loading branch information
petdance committed Jan 20, 2025
1 parent 5f05bf0 commit 26ad88e
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 127 deletions.
5 changes: 0 additions & 5 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@ t/00-load.t
t/FilterTest.pm
t/ack-1.t
t/ack-Q.t
t/ack-c.t
t/ack-c.yaml
t/ack-color.t
t/ack-column.t
t/ack-create-ackrc.t
t/ack-dump.t
t/ack-f.t
t/ack-f.yaml
t/ack-files-from.t
t/ack-g.t
Expand All @@ -53,7 +51,6 @@ t/ack-i.barfly
t/ack-i.t
t/ack-ignore-dir.t
t/ack-ignore-file.t
t/ack-k.t
t/ack-k.yaml
t/ack-l.t
t/ack-m.t
Expand All @@ -72,15 +69,13 @@ t/ack-type-del.t
t/ack-type.t
t/ack-underline.barfly
t/ack-underline.t
t/ack-v.t
t/ack-v.yaml
t/ack-version.t
t/ack-w.barfly
t/ack-w.t
t/ack-x.t
t/anchored.t
t/bad-ackrc-opt.t
t/basic.t
t/basic.yaml
t/boolean.t
t/build_regex.t
Expand Down
24 changes: 0 additions & 24 deletions t/ack-c.t

This file was deleted.

25 changes: 0 additions & 25 deletions t/ack-f.t

This file was deleted.

24 changes: 0 additions & 24 deletions t/ack-k.t

This file was deleted.

24 changes: 0 additions & 24 deletions t/ack-v.t

This file was deleted.

25 changes: 0 additions & 25 deletions t/basic.t

This file was deleted.

33 changes: 33 additions & 0 deletions t/yaml.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!perl

use warnings;
use strict;

use Test::More tests => 5;

use lib 't';
use Util;

prep_environment();

MAIN: {
my @yamlfiles = glob( 't/*.yaml' );

for my $file ( @yamlfiles ) {
subtest $file => sub () {
my @tests = read_tests( $file );

for my $test ( @tests ) {
for my $args ( @{$test->{args}} ) {
subtest $file . ' ' . join( ', ', @{$args} ) => sub {
ack_sets_match( $args, $test->{stdout}, $test->{name} );
is( get_rc(), $test->{exitcode} );
}
}
}
};
}
}


exit 0;

0 comments on commit 26ad88e

Please sign in to comment.