Front page | perl.vmsperl |
Postings from December 2001
[PATCH t/run/switches.t] Declaring mostly TODO
Thread Next
From:
Michael G Schwern
Date:
December 7, 2001 16:41
Subject:
[PATCH t/run/switches.t] Declaring mostly TODO
Message ID:
20011208004131.GC642@blackrider
switches.t is failing not necessarily because there's something wrong
with the command-line swiches on VMS, but because `echo -n "foo" |
perl ...` can't be correctly emulated by run_perl(). VMS will
*always* stick a newline on the end of any piped output.
I don't think this will be fixed anytime soon, and besides, switches.t
shouldn't be punished for it. With the exception of the two tests
which succeed out of dumb luck, this test is entirely TODO. I'll put an
echo -n test into pipe.t once I'm done cleaning that up.
PS this exposed a bug in test.pl and tripped a known bug in
Test::Harness. Test #10 came out as:
not ok 10 - -s on the #! line # TODO runperl() unable to emulate echo -n due to pipe bug
test.pl is responsible for escaping any # in the test name else it'll
interfere with Test::Harness's parsing. So I patched that up.
The second problem is Test::Harness doesn't ignore '\#'. This is a
known bug, and its fixed in the 2.00 alpha but it required completely
rewriting the test parser to do it. Lots of really subtle
possibilities. So I'm not going to patch it up in the hopes that I
get 2.00 up to something releasable before 5.8. Instead, I'll just
change that name to 'shebang'.
--- t/run/switches.t 2001/12/08 00:15:25 1.1
+++ t/run/switches.t 2001/12/08 00:33:52
@@ -11,6 +11,10 @@
plan(tests => 14);
+# due to a bug in VMS's piping which makes it impossible for runperl()
+# to emulate echo -n, these tests almost totally fail.
+$TODO = "runperl() unable to emulate echo -n due to pipe bug" if $^O eq 'VMS';
+
my $r;
my @tmpfiles = ();
END { unlink @tmpfiles }
@@ -63,6 +67,8 @@
my $filename = 'swctest.tmp';
SKIP: {
+ local $TODO = ''; # this one works on VMS
+
open my $f, ">$filename" or skip( "Can't write temp file $filename: $!" );
print $f <<'SWTEST';
BEGIN { print "block 1\n"; }
@@ -122,7 +128,7 @@
progfile => $filename,
args => [ '-x=foo' ],
);
- is( $r, 'foo', '-s on the #! line' );
+ is( $r, 'foo', '-s on the shebang line' );
push @tmpfiles, $filename;
}
@@ -151,7 +157,11 @@
switches => [ '-mswtest' ],
prog => '1',
);
- is( $r, '', '-m' );
+
+ {
+ local $TODO = ''; # this one works on VMS
+ is( $r, '', '-m' );
+ }
$r = runperl(
switches => [ '-mswtest=foo,bar' ],
prog => '1',
--- test.pl 2001/12/08 00:24:01 1.1
+++ test.pl 2001/12/08 00:26:04
@@ -41,6 +41,8 @@
# VMS will avenge.
my $out;
if ($name) {
+ # escape out '#' or it will interfere with '# skip' and such
+ $name =~ s/#/\\#/g;
$out = $pass ? "ok $test - $name" : "not ok $test - $name";
} else {
$out = $pass ? "ok $test" : "not ok $test";
--
Michael G. Schwern <schwern@pobox.com> http://www.pobox.com/~schwern/
Perl Quality Assurance <perl-qa@perl.org> Kwalitee Is Job One
my anus yearns now
warm paste fills me happily
saturday morning
-- imploded
Thread Next
-
[PATCH t/run/switches.t] Declaring mostly TODO
by Michael G Schwern