summaryrefslogtreecommitdiff
path: root/t/run
diff options
context:
space:
mode:
Diffstat (limited to 't/run')
-rw-r--r--t/run/switchPx.aux34
-rw-r--r--t/run/switchPx.t14
2 files changed, 48 insertions, 0 deletions
diff --git a/t/run/switchPx.aux b/t/run/switchPx.aux
new file mode 100644
index 0000000000..68ebc83f79
--- /dev/null
+++ b/t/run/switchPx.aux
@@ -0,0 +1,34 @@
+Some stuff that's not Perl
+
+This CPP directive should not be read.
+#define BARMAR 1
+
+#perl
+
+Still not perl.
+
+#!
+
+still not perl
+
+#!/something/else
+
+still not perl
+
+#!/some/path/that/leads/to/perl -l
+
+# The -l switch should be applied from the #! line.
+# Unfortunately, -P has a bug whereby the #! line is ignored.
+# If this test suddenly starts printing blank lines that bug is fixed.
+
+#define FOO "ok 1\n"
+
+#ifdef BARMAR
+# define YAR "not ok 2\n"
+#else
+# define YAR "ok 2\n"
+#endif
+
+print "1..2\n";
+print FOO;
+print YAR;
diff --git a/t/run/switchPx.t b/t/run/switchPx.t
new file mode 100644
index 0000000000..0f029a7f13
--- /dev/null
+++ b/t/run/switchPx.t
@@ -0,0 +1,14 @@
+#!./perl
+
+# Ensure that the -P and -x flags work together.
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
+require './test.pl';
+
+print runperl( switches => ['-Px'],
+ nolib => 1, # for some reason this is necessary under VMS
+ progfile => 'run/switchPx.aux' );