Skip to content

Commit c3a585e

Browse files
committed
Fudged for niecza.
1 parent 45800f1 commit c3a585e

File tree

1 file changed

+31
-25
lines changed

1 file changed

+31
-25
lines changed

S16-filehandles/filetest.t

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ if $*OS eq "browser" {
2121
# L<S03/Changes to Perl 5 operators/The filetest operators are gone.>
2222
# old: L<S16/Filehandles, files, and directories/A file test, where X is one of the letters listed below.>
2323

24+
#?niecza todo
2425
dies_ok { 't' ~~ :d }, 'file test from before spec revision 27503 is error';
2526

2627
# Basic tests
@@ -68,6 +69,7 @@ ok not 'doesnotexist.t'.IO ~~ :w, "~~:w returns false on non-existent files";
6869
ok not 'doesnotexist.t'.IO ~~ :x, "~~:x returns false on non-existent files";
6970
ok not 'doesnotexist.t'.IO ~~ :f, "~~:f returns false on non-existent files";
7071

72+
#?niecza skip ".s NYI"
7173
ok($*PROGRAM_NAME.IO.s > 42, "~~:s returns size on existent files");
7274

7375
nok "doesnotexist.t".IO ~~ :s, "~~:s returns false on non-existent files";
@@ -78,36 +80,40 @@ nok "t".IO ~~ :z, "~~:z returns false on directories";
7880

7981
my $fh = open("empty_file", :w);
8082
close $fh;
83+
#?niecza todo
8184
ok "empty_file".IO ~~ :z, "~~:z returns true for an empty file";
8285
unlink "empty_file";
8386

84-
if $*OS eq any <MSWin32 mingw msys cygwin> {
85-
skip "~~:M/~~:C/~~:A not working on Win32 yet", 9
86-
}
87-
else {
88-
my $fn = 'test_file_filetest_t';
89-
my $fh = open($fn, :w);
90-
close $fh;
91-
sleep 1; # just to make sure
92-
#?rakudo 3 skip ':M, :C, :A'
93-
ok ($fn.IO ~~ :M) < 0, "~~:M works on new file";
94-
ok ($fn.IO ~~ :C) < 0, "~~:C works on new file";
95-
ok ($fn.IO ~~ :A) < 0, "~~:A works on new file";
96-
unlink $fn;
97-
98-
if "README".IO !~~ :f {
99-
skip "no file README", 3;
100-
} else {
101-
#?rakudo 3 skip ':M, :C, :A'
102-
ok ("README".IO ~~ :M) > 0, "~~:M works on existing file";
103-
ok ("README".IO ~~ :C) > 0, "~~:C works on existing file";
104-
ok ("README".IO ~~ :A) > 0, "~~:A works on existing file";
87+
#?niecza skip "Asynchronous programming NYI exception generated"
88+
{
89+
if $*OS eq any <MSWin32 mingw msys cygwin> {
90+
skip "~~:M/~~:C/~~:A not working on Win32 yet", 9
10591
}
92+
else {
93+
my $fn = 'test_file_filetest_t';
94+
my $fh = open($fn, :w);
95+
close $fh;
96+
sleep 1; # just to make sure
97+
#?rakudo 3 skip ':M, :C, :A'
98+
ok ($fn.IO ~~ :M) < 0, "~~:M works on new file";
99+
ok ($fn.IO ~~ :C) < 0, "~~:C works on new file";
100+
ok ($fn.IO ~~ :A) < 0, "~~:A works on new file";
101+
unlink $fn;
102+
103+
if "README".IO !~~ :f {
104+
skip "no file README", 3;
105+
} else {
106+
#?rakudo 3 skip ':M, :C, :A'
107+
ok ("README".IO ~~ :M) > 0, "~~:M works on existing file";
108+
ok ("README".IO ~~ :C) > 0, "~~:C works on existing file";
109+
ok ("README".IO ~~ :A) > 0, "~~:A works on existing file";
110+
}
106111

107-
#?rakudo 3 skip ':M, :C, :A'
108-
ok not "xyzzy".IO ~~ :M, "~~:M returns undefined when no file";
109-
ok not "xyzzy".IO ~~ :C, "~~:C returns undefined when no file";
110-
ok not "xyzzy".IO ~~ :A, "~~:A returns undefined when no file";
112+
#?rakudo 3 skip ':M, :C, :A'
113+
ok not "xyzzy".IO ~~ :M, "~~:M returns undefined when no file";
114+
ok not "xyzzy".IO ~~ :C, "~~:C returns undefined when no file";
115+
ok not "xyzzy".IO ~~ :A, "~~:A returns undefined when no file";
116+
}
111117
}
112118

113119
# potential parsing difficulties (pugs)

0 commit comments

Comments
 (0)