Subject: | win32 fix for run-samples.t |
use File::Spec->devnull() and 2>&1
patch and fixed file
--
Alexandr Ciornii, http://chorny.net
Subject: | run-samples.t.patch |
--- run-samples.t.dist Mon Aug 29 08:03:44 2005
+++ run-samples.t Tue Mar 18 17:40:19 2008
@@ -29,7 +29,7 @@
diag $command;
}
else {
- $command .= " > /dev/null 2&>1";
+ $command .= ' > '.File::Spec->devnull().' 2>&1';
}
my $exitval = system($command);
Subject: | run-samples.t |
#!perl -w
use warnings;
use strict;
use Test::More;
use File::Spec;
my @tests = qw(
gelem-good.pl
if-then-good.pl
in-out-branch-bad.pl
in-out-branch-good.pl
int-then-string-bad.pl
simple.pl
transitive-bad.pl
transitive-good.pl
unify-glob-bad.pl
unify-glob-good.pl
);
plan tests => scalar @tests;
for my $test ( sort @tests ) {
my $filename = File::Spec->catdir( "t", "samples", $test );
my $command = "$^X -Mblib -MO=TypeCheck,-main $filename";
if ( $ENV{TEST_VERBOSE} ) {
diag $command;
}
else {
$command .= ' > '.File::Spec->devnull().' 2>&1';
}
my $exitval = system($command);
if ($test =~ /-bad\.pl$/) {
isnt( $exitval, 0, "$test should fail" );
} else {
is( $exitval, 0, "$test should pass" );
}
}