diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-04-06 17:09:19 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-04-06 17:09:19 +0000 |
commit | 4512cea31c94e21bbf22ca99a5bb525ea7a8c84c (patch) | |
tree | 628d1180baf59ff2cf578562cdd942fc008cf06b /gnu/usr.bin/perl/t/op/eval.t | |
parent | e852ed17d905386f3bbad057fda2f07926227f89 (diff) |
perl-5.6.0 + local changes
Diffstat (limited to 'gnu/usr.bin/perl/t/op/eval.t')
-rw-r--r-- | gnu/usr.bin/perl/t/op/eval.t | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/gnu/usr.bin/perl/t/op/eval.t b/gnu/usr.bin/perl/t/op/eval.t index dc163e9e8f5..183892389f8 100644 --- a/gnu/usr.bin/perl/t/op/eval.t +++ b/gnu/usr.bin/perl/t/op/eval.t @@ -1,6 +1,6 @@ #!./perl -print "1..36\n"; +print "1..40\n"; eval 'print "ok 1\n";'; @@ -171,3 +171,38 @@ sub terminal { eval 'print $r' } } $x++; +# Have we cured panic which occurred with require/eval in die handler ? +$SIG{__DIE__} = sub { eval {1}; die shift }; +eval { die "ok ".$x++,"\n" }; +print $@; + +# does scalar eval"" pop stack correctly? +{ + my $c = eval "(1,2)x10"; + print $c eq '2222222222' ? "ok $x\n" : "# $c\nnot ok $x\n"; + $x++; +} + +# return from eval {} should clear $@ correctly +{ + my $status = eval { + eval { die }; + print "# eval { return } test\n"; + return; # removing this changes behavior + }; + print "not " if $@; + print "ok $x\n"; + $x++; +} + +# ditto for eval "" +{ + my $status = eval q{ + eval q{ die }; + print "# eval q{ return } test\n"; + return; # removing this changes behavior + }; + print "not " if $@; + print "ok $x\n"; + $x++; +} |