diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-09-07 09:25:24 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-09-07 09:25:24 +0000 |
commit | f23102e2d635682f5818275abd91b9deefde470e (patch) | |
tree | 7a900da7ce36a01ca6766a6172c7f23fa4a30922 /t | |
parent | d052521ac15ab4bed8ae26dfa1c8e09c87be6d3c (diff) | |
download | perl-f23102e2d635682f5818275abd91b9deefde470e.tar.gz |
Remove the 'err' keyword
p4raw-id: //depot/perl@31812
Diffstat (limited to 't')
-rw-r--r-- | t/lib/feature/err | 66 | ||||
-rw-r--r-- | t/lib/warnings/op | 5 | ||||
-rw-r--r-- | t/op/cproto.t | 3 | ||||
-rw-r--r-- | t/op/dor.t | 14 | ||||
-rw-r--r-- | t/run/switches.t | 7 |
5 files changed, 3 insertions, 92 deletions
diff --git a/t/lib/feature/err b/t/lib/feature/err deleted file mode 100644 index 638b5a68ea..0000000000 --- a/t/lib/feature/err +++ /dev/null @@ -1,66 +0,0 @@ -Check the lexical scoping of the err keyword. -(The actual behaviour is tested in t/op/dor.t) - -__END__ -# No err; should be a syntax error. -use warnings; -my $undef err print "Hello!\n"; -EXPECT -Bareword found where operator expected at - line 3, near "$undef err" - (Missing operator before err?) -Unquoted string "err" may clash with future reserved word at - line 3. -syntax error at - line 3, near "$undef err " -Execution of - aborted due to compilation errors. -######## -# With err, should work -use warnings; -use feature "err"; -my $undef err print "Hello", "world"; -EXPECT -Helloworld -######## -# With err, should work in eval too -use warnings; -use feature "err"; -eval q(my $undef err print "Hello", "world"); -EXPECT -Helloworld -######## -# feature out of scope; should be a syntax error. -use warnings; -{ use feature 'err'; } -my $undef err print "Hello", "world"; -EXPECT -Bareword found where operator expected at - line 4, near "$undef err" - (Missing operator before err?) -Unquoted string "err" may clash with future reserved word at - line 4. -syntax error at - line 4, near "$undef err " -Execution of - aborted due to compilation errors. -######## -# 'no feature' should work -use warnings; -use feature 'err'; -my $undef err print "Hello", "world"; -no feature; -my $undef2 err "Hello", "world"; -EXPECT -Bareword found where operator expected at - line 6, near "$undef2 err" - (Missing operator before err?) -Unquoted string "err" may clash with future reserved word at - line 6. -String found where operator expected at - line 6, near "err "Hello"" - (Do you need to predeclare err?) -syntax error at - line 6, near "$undef2 err " -Execution of - aborted due to compilation errors. -######## -# 'no feature "err"' should work too -use warnings; -use feature 'err'; -my $undef err print "Hello", "world"; -no feature 'err'; -$undef err print "Hello", "world"; -EXPECT -Bareword found where operator expected at - line 6, near "$undef err" - (Missing operator before err?) -Unquoted string "err" may clash with future reserved word at - line 6. -syntax error at - line 6, near "$undef err " -Execution of - aborted due to compilation errors. diff --git a/t/lib/warnings/op b/t/lib/warnings/op index 891677fabe..a7445906e6 100644 --- a/t/lib/warnings/op +++ b/t/lib/warnings/op @@ -680,15 +680,10 @@ Value of readdir() operator can be "0"; test with defined() at - line 4. ######## # op.c use warnings 'misc'; -use feature 'err'; open FH, "<abc"; -$_ = <FH> err $_ = 1; ($_ = <FH>) // ($_ = 1); opendir DH, "."; -$_ = readdir DH err $_ = 1; -$_ = <*> err $_ = 1; %a = (1,2,3,4) ; -$_ = each %a err $_ = 1; EXPECT ######## # op.c diff --git a/t/op/cproto.t b/t/op/cproto.t index 3bc8b27aa1..cc2426a5f1 100644 --- a/t/op/cproto.t +++ b/t/op/cproto.t @@ -7,7 +7,7 @@ BEGIN { } BEGIN { require './test.pl'; } -plan tests => 238; +plan tests => 237; while (<DATA>) { chomp; @@ -68,7 +68,6 @@ endpwent () endservent () eof (;*) eq ($$) -err () eval undef exec undef exists undef diff --git a/t/op/dor.t b/t/op/dor.t index 04e0f7d8e7..602a03c16d 100644 --- a/t/op/dor.t +++ b/t/op/dor.t @@ -8,10 +8,9 @@ BEGIN { } package main; -use feature "err"; require './test.pl'; -plan( tests => 35 ); +plan( tests => 31 ); my($x); @@ -26,17 +25,6 @@ is($x // 0, '', ' // : left-hand operand defined but empty'); like([] // 0, qr/^ARRAY/, ' // : left-hand operand a referece'); -$x=1; -is(($x err 0), 1, ' err: left-hand operand defined'); - -$x = undef; -is(($x err 1), 1, ' err: left-hand operand undef'); - -$x=''; -is(($x err 0), '', ' err: left-hand operand defined but empty'); - -like(([] err 0), qr/^ARRAY/, ' err: left-hand operand a referece'); - $x=undef; $x //= 1; is($x, 1, ' //=: left-hand operand undefined'); diff --git a/t/run/switches.t b/t/run/switches.t index 7312e1e64f..317586ed2f 100644 --- a/t/run/switches.t +++ b/t/run/switches.t @@ -11,7 +11,7 @@ BEGIN { BEGIN { require "./test.pl"; } -plan(tests => 62); +plan(tests => 61); use Config; @@ -310,11 +310,6 @@ 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 ~~" ); |