This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
MANIFEST typo
[perl5.git] / t / win32 / fs.t
CommitLineData
23629bd3
TC
1#!./perl
2
3BEGIN {
4 chdir 't' if -d 't';
5 @INC = '../lib';
6 require "./test.pl";
7 eval 'use Errno';
8 die $@ if $@ and !is_miniperl();
9}
10
11use Config;
12
13plan tests => 4;
14
15my $tmpfile1 = tempfile();
16my $tmpfile2 = tempfile();
17
18SKIP: {
19 # RT #112272
20 -e $tmpfile1 || -e $tmpfile2
21 and skip("somehow, the files exist", 4);
22 ok(!link($tmpfile1, $tmpfile2),
23 "Cannot link to unknown file");
23629bd3
TC
24 is(0+$!, &Errno::ENOENT, "check errno is ENOENT");
25 open my $fh, ">", $tmpfile1
26 or skip("Cannot create test link src", 2);
27 close $fh;
28 open my $fh, ">", $tmpfile2
29 or skip("Cannot create test link target", 2);
30 close $fh;
31 ok(!link($tmpfile1, $tmpfile2),
32 "Cannot link to existing file");
23629bd3
TC
33 is(0+$!, &Errno::EEXIST, "check for EEXIST");
34}
35
36END {
37 unlink($tmpfile1, $tmpfile2);
38}