3 # $RCSfile: magic.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:05 $
5 $| = 1; # command buffering
9 eval '$ENV{"foo"} = "hi there";'; # check that ENV is inited inside eval
10 if (`echo \$foo` eq "hi there\n") {print "ok 1\n";} else {print "not ok 1\n";}
12 unlink 'ajslkdfpqjsjfk';
14 open(foo,'ajslkdfpqjsjfk');
15 if ($!) {print "ok 2\n";} else {print "not ok 2\n";}
17 # the next tests are embedded inside system simply because sh spits out
18 # a newline onto stderr when a child process kills itself with SIGINT.
20 system './perl', '-e', <<'END';
22 $| = 1; # command buffering
24 $SIG{"INT"} = "ok3"; kill "INT",$$;
25 $SIG{"INT"} = "IGNORE"; kill 2,$$; print "ok 4\n";
26 $SIG{"INT"} = "DEFAULT"; kill 2,$$; print "not ok\n";
29 if (($x = pop(@_)) eq "INT") {
33 print "not ok 3 $a\n";
39 @val1 = @ENV{keys(%ENV)}; # can we slice ENV?
42 print join(':',@val1) eq join(':',@val2) ? "ok 5\n" : "not ok 5\n";
44 print @val1 > 1 ? "ok 6\n" : "not ok 6\n";