JuliaLang/julia — pull request #6106 by IainNZ (2014-03-10 23:34:41+00:00)
Title: RFC: More detailed messages for basic test macro

(improved/fixed version of https://github.com/JuliaLang/julia/pull/6094)

Perhaps we shouldn't be working on Base.Test and should really just have the @assert macro (to which this functionality could be added) and rely on packages for fancier testing. Having said that, given the fairly widespread usage of @test in both base Julia and many packages, I thought this might at least make things a little nicer for those of us using it.

I think the :comparison case, the simple function call, and the negation of a function call are the most common use cases I've seen. If this is a desirable patch in general, would love to hear of other useful cases that could be added.

Note that if the test fails because an error is thrown then this will not report on any part of the test that was capable of being evaluated - not that I think it really should try.

```julia
mystery1() = 1
mystery5() = 5
@test mystery5() <= mystery1()
ERROR: test failed: mystery5() <= mystery1() [5 <= 1]
```