We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
temp
1 parent b7a19b5 commit 1d4e881Copy full SHA for 1d4e881
S16-io/tmpdir.t
@@ -3,11 +3,21 @@ use Test;
3
4
# L<S16/IO/$*TMPDIR>
5
6
-plan 7;
+plan 9;
7
8
isa-ok $*TMPDIR, IO::Path;
9
lives-ok { $*TMPDIR.perl }, '$*TMPDIR.perl works';
10
lives-ok { $*TMPDIR.gist }, '$*TMPDIR.gist works';
11
12
isa-ok .tmpdir, IO::Path, "{.^name}.tmpdir returns IO::Path"
13
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