summaryrefslogtreecommitdiff
path: root/t/win32
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2020-12-03 11:00:43 +1100
committerTony Cook <tony@develop-help.com>2020-12-03 11:01:51 +1100
commit6483d46092dcc01b5b6d171b889f39b7546a4f79 (patch)
tree57cd08501cf57a47e9370b296a78dc6e7d591305 /t/win32
parent0aee951734c79edb5ed4d81e8c932cc34e5eda55 (diff)
downloadperl-6483d46092dcc01b5b6d171b889f39b7546a4f79.tar.gz
add more win32 stat tests
These tickets were suggested as fixed by the stat updates, some were fixed, but some weren't. Add tests (TODO for the unfixed) to help track them
Diffstat (limited to 't/win32')
-rw-r--r--t/win32/stat.t60
1 files changed, 60 insertions, 0 deletions
diff --git a/t/win32/stat.t b/t/win32/stat.t
index b2dccb8bf2..3ce66ed6ba 100644
--- a/t/win32/stat.t
+++ b/t/win32/stat.t
@@ -175,4 +175,64 @@ if (ok(mkdir($tmpfile1), "make a work directory")) {
rmdir $tmpfile1;
}
+# Other stat issues possibly fixed by the stat() re-work
+
+# https://github.com/Perl/perl5/issues/9025 - win32 - file test operators don't work for //?/UNC/server/file filenames
+# can't really make a reliable regression test for this
+# reproduced original problem with a gcc build
+# confirmed fixed with a gcc build
+
+# https://github.com/Perl/perl5/issues/8502 - filetest problem with STDIN/OUT on Windows
+
+{
+ ok(-r *STDIN, "check stdin is readable");
+ ok(-w *STDOUT, "check stdout is writable");
+
+ # CompareObjectHandles() could fix this, but requires Windows 10
+ local our $TODO = "dupped *STDIN and *STDOUT not read/write";
+ open my $dupin, "<&STDIN" or die;
+ open my $dupout, ">&STDOUT" or die;
+ ok(-r $dupin, "check duplicated stdin is readable");
+ ok(-w $dupout, "check duplicated stdout is writable");
+}
+
+# https://github.com/Perl/perl5/issues/6080 - Last mod time from stat() can be wrong on Windows NT/2000/XP
+# tested already
+
+# https://github.com/Perl/perl5/issues/4145 - Problem with filetest -x _ on Win2k AS Perl build 626
+# tested already
+
+# https://github.com/Perl/perl5/issues/14687 - Function lstat behavior case differs between Windows and Unix #14687
+
+{
+ local our $TODO = "... .... treated as .. by Win32 API";
+ ok(!-e ".....", "non-existing many dots shouldn't returned existence");
+}
+
+# https://github.com/Perl/perl5/issues/7410 - -e tests not reliable under Win32
+{
+ # there's to issues here:
+ # 1) CreateFile() successfully opens " . . " when opened with backup
+ # semantics/directory
+ # 2) opendir(" . . ") becomes FindFirstFile(" . . /*") which fails
+ #
+ # So we end up with success for the first and failure for the second,
+ # making them inconsistent, there may be a Vista level fix for this,
+ # but if we expect -e " . . " to fail we need a more complex fix.
+ local our $TODO = "strange space handling by Windows";
+ ok(!-e " ", "filename ' ' shouldn't exist");
+ ok(!-e " . . ", "filename ' . . ' shouldn't exist");
+ ok(!-e " .. ", "filename ' .. ' shouldn't exist");
+ ok(!-e " . ", "filename ' . ' shouldn't exist");
+
+ ok(!!-e " . . " == !!opendir(FOO, " . . "),
+ "these should be consistent");
+}
+
+# https://github.com/Perl/perl5/issues/12431 - Win32: -e '"' always returns true
+
+{
+ ok(!-e '"', qq(filename '"' shouldn't exist));
+}
+
done_testing();