From: "Jerry D. Hedden" <jdhedden@cpan.org>
Message-ID: <
1ff86f510708090528w5579515bp6f862c613abccf84@mail.gmail.com>
p4raw-id: //depot/perl@31696
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
#!/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";
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
--- /dev/null
+From: foo@bar.xx
+Date: Jan 1, 2037 12:34 PM
+Subject: Ignore mail header
+To: perl@perl.xx
+
+#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";