summaryrefslogtreecommitdiff
path: root/t/run
diff options
context:
space:
mode:
authorRobin Houston <robin@cpan.org>2005-12-21 11:00:08 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-12-21 16:16:19 +0000
commitbc9b29dbf2ff006e91ae1d732887485497f58896 (patch)
tree4147ad5078d3b0f0201672a8a8876a5ace346c4e /t/run
parent565a3db3dc85d0f63074b38e7019290e4f8f3766 (diff)
downloadperl-bc9b29dbf2ff006e91ae1d732887485497f58896.tar.gz
Feature bundle is now :5.10, and add -E switch
Message-ID: <20051221110008.GB25877@rpc142.cs.man.ac.uk> p4raw-id: //depot/perl@26432
Diffstat (limited to 't/run')
-rw-r--r--t/run/switches.t27
1 files changed, 25 insertions, 2 deletions
diff --git a/t/run/switches.t b/t/run/switches.t
index a63c54b9f5..f654486467 100644
--- a/t/run/switches.t
+++ b/t/run/switches.t
@@ -1,7 +1,7 @@
#!./perl -w
# Tests for the command-line switches:
-# -0, -c, -l, -s, -m, -M, -V, -v, -h, -z, -i
+# -0, -c, -l, -s, -m, -M, -V, -v, -h, -z, -i, -E
# Some switches have their own tests, see MANIFEST.
BEGIN {
@@ -11,7 +11,7 @@ BEGIN {
require "./test.pl";
-plan(tests => 26);
+plan(tests => 30);
use Config;
@@ -282,3 +282,26 @@ __EOF__
"foo yada dada:bada foo bing:king kong foo",
"-i backup file");
}
+
+# Tests for -E
+
+$r = runperl(
+ switches => [ '-E', '"say q(Hello, world!)"']
+);
+is( $r, "Hello, world!\n", "-E say" );
+
+
+$r = runperl(
+ switches => [ '-E', '"undef err say q(Hello, world!)"']
+);
+is( $r, "Hello, world!\n", "-E err" );
+
+$r = runperl(
+ switches => [ '-E', '"undef ~~ undef and say q(Hello, world!)"']
+);
+is( $r, "Hello, world!\n", "-E ~~" );
+
+$r = runperl(
+ switches => [ '-E', '"given(undef) {when(undef) { say q(Hello, world!)"}}']
+);
+is( $r, "Hello, world!\n", "-E given" );