diff options
author | Larry Wall <lwall@netlabs.com> | 1991-03-21 00:00:00 +0000 |
---|---|---|
committer | Larry Wall <lwall@netlabs.com> | 1991-03-21 00:00:00 +0000 |
commit | fe14fcc35f78a371a174a1d14256c2f35ae4262b (patch) | |
tree | d472cb1055c47b9701cb0840969aacdbdbc9354a /t/op/magic.t | |
parent | 27e2fb84680b9cc1db17238d5bf10b97626f477f (diff) | |
download | perl-fe14fcc35f78a371a174a1d14256c2f35ae4262b.tar.gz |
perl 4.0.00: (no release announcement available)perl-4.0.00
So far, 4.0 is still a beta test version. For the last production
version, look in pub/perl.3.0/kits@44.
Diffstat (limited to 't/op/magic.t')
-rw-r--r-- | t/op/magic.t | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/t/op/magic.t b/t/op/magic.t new file mode 100644 index 0000000000..f027d60d42 --- /dev/null +++ b/t/op/magic.t @@ -0,0 +1,32 @@ +#!./perl + +# $Header: magic.t,v 4.0 91/03/20 01:53:35 lwall Locked $ + +$| = 1; # command buffering + +print "1..5\n"; + +eval '$ENV{"foo"} = "hi there";'; # check that ENV is inited inside eval +if (`echo \$foo` eq "hi there\n") {print "ok 1\n";} else {print "not ok 1\n";} + +unlink 'ajslkdfpqjsjfk'; +$! = 0; +open(foo,'ajslkdfpqjsjfk'); +if ($! == 2) {print "ok 2\n";} else {print "not ok 2\n";} + +# the next tests are embedded inside system simply because sh spits out +# a newline onto stderr when a child process kills itself with SIGINT. + +system './perl', +'-e', '$| = 1; # command buffering', + +'-e', '$SIG{"INT"} = "ok3"; kill 2,$$;', +'-e', '$SIG{"INT"} = "IGNORE"; kill 2,$$; print "ok 4\n";', +'-e', '$SIG{"INT"} = "DEFAULT"; kill 2,$$; print "not ok\n";', + +'-e', 'sub ok3 { print "ok 3\n" if pop(@_) eq "INT"; }'; + +@val1 = @ENV{keys(%ENV)}; # can we slice ENV? +@val2 = values(%ENV); + +print join(':',@val1) eq join(':',@val2) ? "ok 5\n" : "not ok 5\n"; |