Custom error message from @test macro


#1

Is there a way to specify a custom error message for the @test macro to print if it fails? Something like,

@test a==b "a didn't equal b"

The problem is that e.g. if a and b are large vectors then if the test fails they get fully printed to the output making the result basically unreadable.


#2

Hi, I just stumbled upon a similar problem and found this thread. You can try this as workaround:

@test a==b || "a didn't equal b"

#3

That’s nice, thanks!