Skip to content

Commit 1d4e881

Browse files
committed
[io grant] Test $*TMPDIR can be temped
Rakudo fix: rakudo/rakudo@b62d1a768a
1 parent b7a19b5 commit 1d4e881

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

S16-io/tmpdir.t

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@ use Test;
33

44
# L<S16/IO/$*TMPDIR>
55

6-
plan 7;
6+
plan 9;
77

88
isa-ok $*TMPDIR, IO::Path;
99
lives-ok { $*TMPDIR.perl }, '$*TMPDIR.perl works';
1010
lives-ok { $*TMPDIR.gist }, '$*TMPDIR.gist works';
1111

1212
isa-ok .tmpdir, IO::Path, "{.^name}.tmpdir returns IO::Path"
1313
for IO::Spec::Unix, IO::Spec::Win32, IO::Spec::Cygwin, IO::Spec::QNX;
14+
15+
{
16+
my $before = $*TMPDIR;
17+
{
18+
temp $*TMPDIR = '/foo'.IO;
19+
is-deeply $*TMPDIR, '/foo'.IO, 'was able to `temp` $*TMPDIR';
20+
}
21+
is-deeply $*TMPDIR, $before,
22+
'`temp`ed $*TMPDIR got restored to previous value';
23+
}

0 commit comments

Comments
 (0)