Custom error message from @test macro


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.


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"


That’s nice, thanks!