Subject: | t/capture-ext.t fails on Win32 |
The t/capture-ext.t test fails in Win32 (and, really, any system which
does not have an external "echo" program). Technically running
system('echo', 'Hello World') does work on Win32, but IPC::Cmd looks for
the program named echo, which does not exist. system() is make to retry
failed commands within the cmd.exe shell on Win32, thus allowing echo to
work.
My suggestion for fixing the test is to change the test to just also
accept the valid output "Program 'echo' not found" for the hello
command. I have attached what I think may be a solution.
Subject: | 0001-t-capture-ext.t-should-handle-valid-error-output.patch |
From f03ce6b5fed7f99b0436c410ba4bbe2ad830a1bd Mon Sep 17 00:00:00 2001
From: Douglas Christopher Wilson <doug@somethingdoug.com>
Date: Wed, 11 Jan 2012 10:58:13 -0500
Subject: [PATCH] t/capture-ext.t should handle valid error output.
---
t/capture-ext.t | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/t/capture-ext.t b/t/capture-ext.t
index 82daf32..a6466bb 100644
--- a/t/capture-ext.t
+++ b/t/capture-ext.t
@@ -16,5 +16,9 @@ isa_ok($app, 'Test::MyCmd');
my $return = test_app('Test::MyCmd', [ qw(hello) ]);
-like( $return->output, qr/Hello World/, "Captured external subcommand output" );
+if (defined $return->error) {
+ like( $return->error, qr/Program 'echo' not found/, "Captured external subcommand output - no echo" );
+} else {
+ like( $return->output, qr/Hello World/, "Captured external subcommand output" );
+}
--
1.7.6.msysgit.0