Skip to content

Commit

Permalink
Explicitly call grok with $^X in tests, needed on Win32
Browse files Browse the repository at this point in the history
We can't call it directly because it's not executable (no .exe extension
on it yet).
  • Loading branch information
hinrik committed Jun 30, 2009
1 parent 5b7798e commit 46c3329
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 17 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -1,3 +1,6 @@
0.07
- Explicitly call grok with $^X in tests, needed on Win32

0.06 Fri Jun 26 08:19:06 GMT 2009
- Add -l/--only option to print the path to the target file
- Bail out with an error message when target is unknown
Expand Down
4 changes: 2 additions & 2 deletions t/03_opts/01_file.t
Expand Up @@ -5,8 +5,8 @@ use Test::More tests => 6;

my $script = catfile('script', 'grok');
my $pod = catfile('t_source', 'basic.pod');
my $result_short = qx/$script -F $pod/;
my $result_long = qx/$script --file $pod/;
my $result_short = qx/$^X $script -F $pod/;
my $result_long = qx/$^X $script --file $pod/;

for my $para (qw(Foo Bar Baz)) {
like($result_short, qr/$para/, "Paragraph $para (short)");
Expand Down
8 changes: 4 additions & 4 deletions t/03_opts/02_format.t
Expand Up @@ -5,10 +5,10 @@ use Test::More tests => 4;

my $script = catfile('script', 'grok');
my $pod = catfile('t_source', 'basic.pod');
my $result_text_short = qx/$script -F $pod -f text/;
my $result_text_long = qx/$script -F $pod --format text/;
my $result_ansi_short = qx/$script -F $pod -f ansi/;
my $result_ansi_long = qx/$script -F $pod --format ansi/;
my $result_text_short = qx/$^X $script -F $pod -f text/;
my $result_text_long = qx/$^X $script -F $pod --format text/;
my $result_ansi_short = qx/$^X $script -F $pod -f ansi/;
my $result_ansi_long = qx/$^X $script -F $pod --format ansi/;

isnt($result_text_short, $result_ansi_short, "Text and Ansi are different (short)");
like($result_ansi_short, qr/\e\[/, "Ansi has color codes (short)");
Expand Down
4 changes: 2 additions & 2 deletions t/03_opts/03_help.t
Expand Up @@ -4,8 +4,8 @@ use File::Spec::Functions 'catfile';
use Test::More tests => 2;

my $script = catfile('script', 'grok');
my $result_short = qx/$script -h/;
my $result_long = qx/$script --help/;
my $result_short = qx/$^X $script -h/;
my $result_long = qx/$^X $script --help/;

like($result_short, qr/Options:/, "Got help message (short)");
like($result_long, qr/Options:/, "Got help message (long)");
Expand Down
4 changes: 2 additions & 2 deletions t/03_opts/04_version.t
Expand Up @@ -4,8 +4,8 @@ use File::Spec::Functions 'catfile';
use Test::More tests => 2;

my $script = catfile('script', 'grok');
my $result_short = qx/$script -v/;
my $result_long = qx/$script --version/;
my $result_short = qx/$^X $script -v/;
my $result_long = qx/$^X $script --version/;

like($result_short, qr/^grok \d/, "Got version info (short)");
like($result_long, qr/^grok \d/, "Got version info (long)");
Expand Down
6 changes: 3 additions & 3 deletions t/03_opts/05_no_pager.t
Expand Up @@ -5,9 +5,9 @@ use Test::More tests => 2;

my $script = catfile('script', 'grok');
my $pod = catfile('t_source', 'basic.pod');
my $result_paged = qx/$script -F $pod/; # TODO: test this
my $result_unpaged_short = qx/$script -F $pod -T/;
my $result_unpaged_long = qx/$script -F $pod --no-pager/;
my $result_paged = qx/$^X $script -F $pod/; # TODO: test this
my $result_unpaged_short = qx/$^X $script -F $pod -T/;
my $result_unpaged_long = qx/$^X $script -F $pod --no-pager/;

ok(length $result_unpaged_short, 'Got unpaged output (-T)');
ok(length $result_unpaged_long, 'Got unpaged output (--no-pager)');
Expand Down
2 changes: 1 addition & 1 deletion t/04_targets/01_file.t
Expand Up @@ -10,5 +10,5 @@ $ENV{GROK_SHAREDIR} = 'share';
my $file = catfile('t_source', 'basic.pod');
my $grok = catfile('script', 'grok');

my $result = qx/$grok $file/;
my $result = qx/$^X $grok $file/;
like($result, qr/Baz/, "Got result");
6 changes: 3 additions & 3 deletions t/04_targets/02_synopsis.t
Expand Up @@ -6,9 +6,9 @@ use Test::More tests => 3;
$ENV{GROK_SHAREDIR} = 'share';
my $grok = catfile('script', 'grok');

my $s02 = qx/$grok s02/;
my $s26 = qx/$grok s26/;
my $s32_except = qx/$grok s32-except/;
my $s02 = qx/$^X $grok s02/;
my $s26 = qx/$^X $grok s26/;
my $s32_except = qx/$^X $grok s32-except/;

like($s02, qr/Synopsis 2/, "Got S02");
like($s26, qr/Synopsis 26/, "Got S26");
Expand Down

0 comments on commit 46c3329

Please sign in to comment.