File: tmpdir.t

package info (click to toggle)
perl 5.10.1-17squeeze6
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 74,280 kB
  • ctags: 49,087
  • sloc: perl: 319,380; ansic: 193,238; sh: 37,981; pascal: 8,830; lisp: 7,515; cpp: 3,893; makefile: 2,375; xml: 1,972; yacc: 1,555
file content (31 lines) | stat: -rwxr-xr-x 828 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use strict;
use Test;

# Grab all of the plain routines from File::Spec
use File::Spec;
use File::Spec::Win32;

plan tests => 4;

ok 1, 1, "Loaded";

if ($^O eq 'VMS') {
    # hack:
    # Need to cause the %ENV to get populated or you only get the builtins at
    # first, and then something else can cause the hash to get populated.
    my %look_env = %ENV;
}
my $num_keys = keys %ENV;
File::Spec->tmpdir;
ok scalar keys %ENV, $num_keys, "tmpdir() shouldn't change the contents of %ENV";

if ($^O eq 'VMS') {
  skip("Can't make list assignment to %ENV on this system", 1);
} else {
  local %ENV;
  File::Spec::Win32->tmpdir;
  ok scalar keys %ENV, 0, "Win32->tmpdir() shouldn't change the contents of %ENV";
}

File::Spec::Win32->tmpdir;
ok scalar keys %ENV, $num_keys, "Win32->tmpdir() shouldn't change the contents of %ENV";