Change 31696 by [EMAIL PROTECTED] on 2007/08/09 15:00:25

        Subject: [PATCH] Test '-x dir'
        From: "Jerry D. Hedden" <[EMAIL PROTECTED]>
        Date: Thu, 9 Aug 2007 08:28:17 -0400
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/MANIFEST#1610 edit
... //depot/perl/t/run/switchx.aux#2 edit
... //depot/perl/t/run/switchx.t#4 edit
... //depot/perl/t/run/switchx2.aux#1 add

Differences ...

==== //depot/perl/MANIFEST#1610 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST#1609~31689~   2007-08-08 10:27:48.000000000 -0700
+++ perl/MANIFEST       2007-08-09 08:00:25.000000000 -0700
@@ -3876,6 +3876,7 @@
 t/run/switchPx.t               Test the -Px combination
 t/run/switcht.t                        Test the -t switch
 t/run/switchx.aux              Data for switchx.t
+t/run/switchx2.aux             Data for switchx.t
 t/run/switchx.t                        Test the -x switch
 t/TEST                         The regression tester
 t/TestInit.pm                  Preamble library for core tests

==== //depot/perl/t/run/switchx.aux#2 (text) ====
Index: perl/t/run/switchx.aux
--- perl/t/run/switchx.aux#1~13027~     2001-11-15 13:16:57.000000000 -0800
+++ perl/t/run/switchx.aux      2007-08-09 08:00:25.000000000 -0700
@@ -17,5 +17,14 @@
 
 #!/some/path/that/leads/to/perl -l
 
-print "1..1";
-print "ok 1";
+print "1..4";
+if (-f 'run/switchx.aux') {
+    print "ok 1";
+}
+print "ok 2";
+# other tests are in switchx2.aux
+
+__END__
+
+# This is ignored
+print "not ok 2";

==== //depot/perl/t/run/switchx.t#4 (text) ====
Index: perl/t/run/switchx.t
--- perl/t/run/switchx.t#3~22091~       2004-01-07 11:09:50.000000000 -0800
+++ perl/t/run/switchx.t        2007-08-09 08:00:25.000000000 -0700
@@ -8,4 +8,13 @@
 require './test.pl';
 use File::Spec::Functions;
 
-print runperl( switches => ['-x'], progfile => catfile(curdir(), 'run', 
'switchx.aux') );
+# Test '-x'
+print runperl( switches => ['-x'],
+               progfile => catfile(curdir(), 'run', 'switchx.aux') );
+
+# Test '-xdir'
+print runperl( switches => ['-x' . catfile(curdir(), 'run')],
+               progfile => catfile(curdir(), 'run', 'switchx2.aux'),
+               args     => [ 3 ] );
+
+# EOF

==== //depot/perl/t/run/switchx2.aux#1 (text) ====
Index: perl/t/run/switchx2.aux
--- /dev/null   2007-03-19 09:41:43.516454971 -0700
+++ perl/t/run/switchx2.aux     2007-08-09 08:00:25.000000000 -0700
@@ -0,0 +1,32 @@
+From: [EMAIL PROTECTED]
+Date: Jan 1, 2037 12:34 PM
+Subject: Ignore mail header
+To: [EMAIL PROTECTED]
+
+#perl
+Not perl
+
+#!
+Still not perl
+
+#!/something/else
+Still not perl
+
+#!/usr/bin/bash
+# Ignore shell commands
+if [[ -z $FOO ]]; then echo 'not ok 1'; fi
+
+#!/some/path/that/leads/to/perl -l
+
+# These lines get executed
+my $test = $ARGV[0];
+if (-f 'switchx.t') {
+    print("ok $test");
+}
+$test++;
+print "ok $test";
+
+__END__
+
+# This is ignored
+print "not ok $test";
End of Patch.

Reply via email to