Test macro that checks no exception was thrown?

I want to implement a test that just need to know the function did not throw any exception. There’s @test_throws but that’s the exact opposite of what I need. Is there anything like that?

I could work around by using regular @test with an expected result but I don’t really care about the calculation in this case.

Option 1:

@test_nowarn foo()

Option 2:

@test foo() isa Any
5 Likes

The following gives a fail instead of an error when an exception is thrown:

@test try foo()
    true
catch
    false
end