summaryrefslogtreecommitdiff
path: root/t/op/runlevel.t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-08-07 10:12:44 +0000
committerNicholas Clark <nick@ccl4.org>2008-08-07 10:12:44 +0000
commit1c25d394345c1b97c9cfd949fe3d2e3296fd9681 (patch)
treeeae05365e0036fad7135cb0b5681b1c1fe146571 /t/op/runlevel.t
parent748a4b20dad489edbf351cfb9cf18f6da44f79f5 (diff)
downloadperl-1c25d394345c1b97c9cfd949fe3d2e3296fd9681.tar.gz
Use test.pl's tempfile().
p4raw-id: //depot/perl@34180
Diffstat (limited to 't/op/runlevel.t')
-rwxr-xr-xt/op/runlevel.t7
1 files changed, 3 insertions, 4 deletions
diff --git a/t/op/runlevel.t b/t/op/runlevel.t
index 36c63effac..c1038120ef 100755
--- a/t/op/runlevel.t
+++ b/t/op/runlevel.t
@@ -8,6 +8,7 @@
chdir 't' if -d 't';
@INC = '../lib';
+require './test.pl';
$Is_VMS = $^O eq 'VMS';
$Is_MSWin32 = $^O eq 'MSWin32';
$Is_NetWare = $^O eq 'NetWare';
@@ -20,9 +21,7 @@ undef $/;
@prgs = split "\n########\n", <DATA>;
print "1..", scalar @prgs, "\n";
-$tmpfile = "runltmp000";
-1 while -f ++$tmpfile;
-END { if ($tmpfile) { 1 while unlink $tmpfile; } }
+$tmpfile = tempfile();
for (@prgs){
my $switch = "";
@@ -45,7 +44,7 @@ for (@prgs){
my $status = $?;
$results =~ s/\n+$//;
# allow expected output to be written as if $prog is on STDIN
- $results =~ s/runltmp\d+/-/g;
+ $results =~ s/$::tempfile_regexp/-/g;
$results =~ s/\n%[A-Z]+-[SIWEF]-.*$// if $Is_VMS; # clip off DCL status msg
$expected =~ s/\n+$//;
if ($results ne $expected) {