Fix when( scalar ... ) bug
[p5sagit/p5-mst-13.2.git] / ext / Cwd / t / tmpdir.t
CommitLineData
9d5071ba 1use strict;
2use Test;
3
4# Grab all of the plain routines from File::Spec
5use File::Spec;
6use File::Spec::Win32;
7
dfa4e5d3 8plan tests => 4;
9d5071ba 9
10ok 1, 1, "Loaded";
11
ae5a807c 12if ($^O eq 'VMS') {
13 # hack:
14 # Need to cause the %ENV to get populated or you only get the builtins at
15 # first, and then something else can cause the hash to get populated.
16 my %look_env = %ENV;
17}
9d5071ba 18my $num_keys = keys %ENV;
19File::Spec->tmpdir;
20ok scalar keys %ENV, $num_keys, "tmpdir() shouldn't change the contents of %ENV";
21
3eb182fc 22if ($^O eq 'VMS') {
bf7c0a3d 23 skip("Can't make list assignment to %ENV on this system", 1);
24} else {
dfa4e5d3 25 local %ENV;
26 File::Spec::Win32->tmpdir;
27 ok scalar keys %ENV, 0, "Win32->tmpdir() shouldn't change the contents of %ENV";
28}
29
9d5071ba 30File::Spec::Win32->tmpdir;
31ok scalar keys %ENV, $num_keys, "Win32->tmpdir() shouldn't change the contents of %ENV";