Customize test failure display

I like how it shows the values of y and x here

julia> @test y < x
Test Failed at REPL[6]:1
  Expression: y < x
   Evaluated: 2 < 1

Can I make it do that for the arguments of my custom function too?

julia> eq(x,y) = x == y;

julia> @test eq(x,y)
Test Failed at REPL[5]:1
  Expression: eq(x, y)

There are a few options listed here:

1 Like