250526.10 · 3688ff0cd1dbb058b9530d8ff673687e1129ab44
Move some tests to YAML
reading declarations
Changes to t/ack-g.t. All files
@@ -3,62 +3,13 @@ use warnings; use strict; -use Test::More tests => 5;+use Test::More tests => 2; use lib 't'; use Util; prep_environment(); -subtest 'No starting directory specified' => sub {- plan tests => 3;-- my $regex = 'non';-- my @files = qw( t/foo/non-existent );- my @args = ( '-g', $regex );- my ($stdout, $stderr) = run_ack_with_stderr( @args, @files );-- is_empty_array( $stdout, 'No STDOUT for non-existent file' );- is( scalar @{$stderr}, 1, 'One line of STDERR for non-existent file' );- like( $stderr->[0], qr/non-existent: No such file or directory/,- 'Correct warning message for non-existent file' );-};---subtest 'regex comes before -g on the command line' => sub {- plan tests => 3;-- my $regex = 'non';-- my @files = qw( t/foo/non-existent );- my @args = ( $regex, '-g' );- my ($stdout, $stderr) = run_ack_with_stderr( @args, @files );-- is_empty_array( $stdout, 'No STDOUT for non-existent file' );- is( scalar @{$stderr}, 1, 'One line of STDERR for non-existent file' );- like( $stderr->[0], qr/non-existent: No such file or directory/,- 'Correct warning message for non-existent file' );-};----subtest 'test exit codes' => sub {- plan tests => 4;-- my $file_regex = 'foo';- my @files = ( 't/text/' );-- run_ack( '-g', $file_regex, @files );- is( get_rc(), 1, '-g with no matches must exit with 1' );-- $file_regex = 'raven';-- run_ack( '-g', $file_regex, @files );- is( get_rc(), 0, '-g with matches must exit with 0' );-};-- subtest 'test -g with --color' => sub { plan tests => 2;