File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -922,3 +922,25 @@ test_12992()
922
922
test2_12992 ()
923
923
test2_12992 ()
924
924
test2_12992 ()
925
+
926
+ # issue 13559
927
+
928
+ function test_13559 ()
929
+ fn = tempname ()
930
+ run (` mkfifo $fn ` )
931
+ # use subprocess to write 127 bytes to FIFO
932
+ writer_cmds = " x=open(\" $fn \" , \" w\" ); for i=1:127 write(x,0xaa); flush(x); sleep(0.1) end; close(x); quit()"
933
+ open (` $(Base. julia_cmd ()) -e $writer_cmds ` )
934
+ # quickly read FIFO, draining it and blocking but not failing with EOFError yet
935
+ r = open (fn, " r" )
936
+ # 15 proper reads
937
+ for i= 1 : 15
938
+ @test read (r, Int64) == - 6148914691236517206
939
+ end
940
+ # last read should throw EOFError when FIFO closes, since there are only 7 bytes available.
941
+ @test_throws EOFError read (r, Int64)
942
+ close (r)
943
+ rm (fn)
944
+ end
945
+
946
+ @unix_only test_13559 ()
You can’t perform that action at this time.
0 commit comments