6 [ "file", "unix", "win32", "mac" ],
7 #---------------- ------------ --------------- --------------
8 [ "file://localhost/foo/bar",
9 "!/foo/bar", "!\\foo\\bar", "!foo:bar", ],
11 "/foo/bar", "\\foo\\bar", "!foo:bar", ],
12 [ "file:/foo/bar", "!/foo/bar", "!\\foo\\bar", "foo:bar", ],
13 [ "foo/bar", "foo/bar", "foo\\bar", ":foo:bar",],
14 [ "file://foo/bar","!//foo/bar", "!\\\\foo\\bar", "!foo:bar"],
15 [ "file://a:/", "!//a:/", "!A:\\", undef],
16 [ "file:///A:/", "/A:/", "A:\\", undef],
17 [ "file:///", "/", "\\", undef],
18 [ ".", ".", ".", ":"],
19 [ "..", "..", "..", "::"],
20 [ "%2E", "!.", "!.", ":."],
21 [ "../%2E%2E", "!../..", "!..\\..", "::.."],
24 @os = @{shift @tests};
37 my $u = URI->new($file, "file");
40 my $f = $u->file($os);
42 $f = "<undef>" unless defined $f;
43 $expect = "<undef>" unless defined $expect;
45 $loose++ if $expect =~ s/^!//;
47 print "URI->new('$file', 'file')->file('$os') ne $expect, but $f\n";
50 if (defined($t[$i]) && !$loose) {
51 $u2 = URI::file->new($t[$i], $os);
52 unless ($u2->as_string eq $file) {
53 print "URI::file->new('$t[$i]', '$os') ne $file, but $u2\n";