summaryrefslogtreecommitdiff
path: root/t/win32/fs.t
blob: 35d3617edccd88f21ad18d02bc29946d3c88f3bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!./perl

BEGIN {
    chdir 't' if -d 't';
    @INC = '../lib';
    require "./test.pl";
    eval 'use Errno';
    die $@ if $@ and !is_miniperl();
}

plan tests => 4;

my $tmpfile1 = tempfile();
my $tmpfile2 = tempfile();

# RT #112272
ok(!link($tmpfile1, $tmpfile2),
   "Cannot link to unknown file");
is(0+$!, &Errno::ENOENT, "check errno is ENOENT");
open my $fh, ">", $tmpfile1
    or skip("Cannot create test link src", 2);
close $fh;
open my $fh, ">", $tmpfile2
    or skip("Cannot create test link target", 2);
close $fh;
ok(!link($tmpfile1, $tmpfile2),
   "Cannot link to existing file");
is(0+$!, &Errno::EEXIST, "check for EEXIST");