diff options
author | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1998-01-08 12:10:29 +0000 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1998-01-08 12:10:29 +0000 |
commit | 8cd305a30c9816c0c0e4535a1f79fd802d791fb4 (patch) | |
tree | c8b9d238ae8714c4da2390dfeca15ee66cc454cf /t | |
parent | 709439144118cdc3bfd83a3cfee0f545203abc22 (diff) | |
parent | e7152ba2733b9227708ca768b222144415c13c66 (diff) | |
download | perl-8cd305a30c9816c0c0e4535a1f79fd802d791fb4.tar.gz |
Integrate win32 branch into mainline.
p4raw-id: //depot/perl@397
Diffstat (limited to 't')
-rwxr-xr-x | t/op/eval.t | 21 | ||||
-rwxr-xr-x | t/op/magic.t | 27 |
2 files changed, 41 insertions, 7 deletions
diff --git a/t/op/eval.t b/t/op/eval.t index 6d0a67b533..02b1045344 100755 --- a/t/op/eval.t +++ b/t/op/eval.t @@ -2,7 +2,7 @@ # $RCSfile: eval.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:48 $ -print "1..16\n"; +print "1..22\n"; eval 'print "ok 1\n";'; @@ -54,4 +54,21 @@ eval { 1; } || print "ok 15\n$@"; - +# check whether eval EXPR determines value of EXPR correctly + +{ + my @a = qw(a b c d); + my @b = eval @a; + print "@b" eq '4' ? "ok 17\n" : "not ok 17\n"; + print $@ ? "not ok 18\n" : "ok 18\n"; + + my $a = q[defined(wantarray) ? (wantarray ? ($b='A') : ($b='S')) : ($b='V')]; + my $b; + @a = eval $a; + print "@a" eq 'A' ? "ok 19\n" : "# $b\nnot ok 19\n"; + print $b eq 'A' ? "ok 20\n" : "# $b\nnot ok 20\n"; + $_ = eval $a; + print $b eq 'S' ? "ok 21\n" : "# $b\nnot ok 21\n"; + eval $a; + print $b eq 'V' ? "ok 22\n" : "# $b\nnot ok 22\n"; +} diff --git a/t/op/magic.t b/t/op/magic.t index 80361ba0b7..ace49b546d 100755 --- a/t/op/magic.t +++ b/t/op/magic.t @@ -24,7 +24,7 @@ $Is_VMS = $^O eq 'VMS'; $Is_Dos = $^O eq 'dos'; $PERL = ($Is_MSWin32 ? '.\perl' : './perl'); -print "1..30\n"; +print "1..34\n"; eval '$ENV{"FOO"} = "hi there";'; # check that ENV is inited inside eval if ($Is_MSWin32) { ok 1, `cmd /x /c set FOO` eq "FOO=hi there\n"; } @@ -37,8 +37,8 @@ ok 2, $!, $!; close FOO; # just mention it, squelch used-only-once if ($Is_MSWin32 || $Is_Dos) { - ok 3,1; - ok 4,1; + ok "3 # skipped",1; + ok "4 # skipped",1; } else { # the next tests are embedded inside system simply because sh spits out @@ -165,8 +165,8 @@ ok 27, $^O; ok 28, $^T > 850000000, $^T; if ($Is_VMS || $Is_Dos) { - ok 29, 1; - ok 30, 1; + ok "29 # skipped", 1; + ok "30 # skipped", 1; } else { $PATH = $ENV{PATH}; @@ -182,3 +182,20 @@ else { : (`echo \$NoNeSuCh` eq "foo\n") ); } +# test case-insignificance of %ENV (these tests must be enabled only +# when perl is compiled with -DENV_IS_CASELESS) +if ($Is_MSWin32) { + %ENV = (); + $ENV{'Foo'} = 'bar'; + $ENV{'fOo'} = 'baz'; + ok 31, (scalar(keys(%ENV)) == 1); + ok 32, exists($ENV{'FOo'}); + ok 33, (delete($ENV{'foO'}) eq 'baz'); + ok 34, (scalar(keys(%ENV)) == 0); +} +else { + ok "31 # skipped",1; + ok "32 # skipped",1; + ok "33 # skipped",1; + ok "34 # skipped",1; +} |