diff options
author | Tomasz Konojacki <me@xenu.pl> | 2021-04-05 15:44:54 +0200 |
---|---|---|
committer | xenu <me@xenu.pl> | 2021-05-21 06:04:59 +0200 |
commit | e9ef73dff5d02384109a08f908bbb1bbecb4427b (patch) | |
tree | ea2709cb85134f57206e7ed1504ad58e36c38299 | |
parent | 52f06022a18bb154b7c77169e3e8bdaeee5dcdac (diff) | |
download | perl-e9ef73dff5d02384109a08f908bbb1bbecb4427b.tar.gz |
IO: add a test for sync()
We already had a test which called sync(), but the new test exercises a
much more common scenario.
-rw-r--r-- | dist/IO/t/io_xs.t | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/dist/IO/t/io_xs.t b/dist/IO/t/io_xs.t index 4657088629..c9b8836b32 100644 --- a/dist/IO/t/io_xs.t +++ b/dist/IO/t/io_xs.t @@ -11,7 +11,7 @@ BEGIN { } } -use Test::More tests => 10; +use Test::More tests => 11; use IO::File; use IO::Seekable; @@ -36,6 +36,15 @@ $x->setpos(undef); ok($!, "setpos(undef) makes errno non-zero"); SKIP: +{ + $Config{d_fsync} || $^O eq 'MSWin32' + or skip "No fsync", 1; + + ok($x->sync, "sync on a writable handle") + or diag "sync(): ", $!; +} + +SKIP: { # [perl #64772] IO::Handle->sync fails on an O_RDONLY descriptor $Config{d_fsync} or skip "No fsync", 1; |