I'd like to write something along the lines of
using Test
@test_throws DomainError run(`julia -e 'sqrt(-1)'`)
Is that possible somehow?
no, because the DomainError
doesn't make it to the spawning process
it's handled by the spawned process, the only thing run
ends up seeing is the exit code of the process
when dealing with subprocesses, you're limited to what they're communicating outside, either via various output streams, an exit code or explicit communication
what you can do is search for DomainError
in the stdout/stderr of the spawned process, but that's not reliable due to other output possibly creating a false positive
Thanks! I feared it would be like that..
Last updated: Dec 28 2024 at 04:38 UTC