11 # Need to run this in a quiet private directory as it assumes that it can
12 # reliably delete fixed file names.
13 my $tempdir = tempfile;
15 mkdir $tempdir, 0700 or die "Can't mkdir '$tempdir': $!";
16 chdir $tempdir or die die "Can't chdir '$tempdir': $!";
20 open my $fh, ">", $file or die "Can't open $file: $!";
21 close $fh or die "Can't close $file: $!";
25 is unlink('aaa'), 1, 'retval of unlink with one file name';
26 ok (!-e 'aaa', 'unlink unlinked it');
27 make_file($_) for 'aaa', 'bbb';
28 is unlink('aaa','bbb','ccc'), 2,
29 'retval of unlink with list that includes nonexistent file';
30 ok (!-e 'aaa' && !-e 'bbb', 'unlink unlank the files it claims it unlank');
33 is unlink, 1, 'retval of unlink with no args';
34 ok !-e 'zzz', 'unlink with no arg unlinked $_';
37 chdir '..' or die "Couldn't chdir .. for cleanup: $!";
38 rmdir $tempdir or die "Couldn't unlink tempdir '$tempdir': $!";