Skip to content

Commit e3f29f1

Browse files
committed
Don't run the partial write() test on Windows
1 parent 49f2ad7 commit e3f29f1

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

test/file.jl

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2202,22 +2202,24 @@ end
22022202
@test Base.infer_return_type(stat, (String,)) == Base.Filesystem.StatStruct
22032203

22042204
# Partial write() to File should return the actual number of bytes written
2205-
@test let p = Pipe()
2206-
# Create a non-blocking pipe that will fill and return EAGAIN
2207-
Base.link_pipe!(p; writer_supports_async=true, reader_supports_async=true)
2208-
try
2209-
f = Base.Filesystem.File(Base._fd(p.in))
2210-
n_read, n_write = 0, 0
2211-
@sync begin
2212-
@async begin
2213-
n_write = write(f, rand(UInt8, 1000000))
2214-
close(p.in)
2205+
if !Sys.iswindows()
2206+
@test let p = Pipe()
2207+
# Create a non-blocking pipe that will fill and return EAGAIN
2208+
Base.link_pipe!(p; writer_supports_async=true, reader_supports_async=true)
2209+
try
2210+
f = Base.Filesystem.File(Base._fd(p.in))
2211+
n_read, n_write = 0, 0
2212+
@sync begin
2213+
@async begin
2214+
n_write = write(f, rand(UInt8, 1000000))
2215+
close(p.in)
2216+
end
2217+
n_read = length(read(p))
22152218
end
2216-
n_read = length(read(p))
2219+
n_write == n_read
2220+
finally
2221+
close(p)
22172222
end
2218-
n_write == n_read
2219-
finally
2220-
close(p)
22212223
end
22222224
end
22232225

0 commit comments

Comments
 (0)