This currently fails:
using IOCapture, Test
function test_puts(str)
cap = IOCapture.capture() do
@ccall puts(str::Cstring)::Cint
end
@test cap.value == length(str) + 1
end
test_puts("Hello World\n"^100_000)
For Julia-only code using e.g. print this works fine.
Using Libc.flush_cstdio() doesn't seem to help:
function test_puts_flush(str)
cap = IOCapture.capture() do
ret = @ccall puts(str::Cstring)::Cint
Libc.flush_cstdio()
ret
end
@test cap.value == length(str) + 1
end
test_puts_flush("Hello World\n"^100_000)
Related: JuliaIO/Suppressor.jl#46 and JuliaIO/Suppressor.jl#47
This currently fails:
For Julia-only code using e.g.
printthis works fine.Using
Libc.flush_cstdio()doesn't seem to help:Related: JuliaIO/Suppressor.jl#46 and JuliaIO/Suppressor.jl#47