com-lihaoyi / utest

A simple testing framework for Scala

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

assert doesn't report, on screen, the compared values when the statement is complex

tanin47 opened this issue · comments

It seems, when we have a complex statement within assert, it won't report the two values on screen. Here's an example:

X givers.form.MappingsSpec.int.validates 0ms
  utest.AssertionError: assert(Mappings.int(min = 10).bind(JsDefined(JsNumber(9))) == Failure(Mapping.ValidationException("error.min", 10)))
    utest.asserts.Asserts$.assertImpl(Asserts.scala:114)
    givers.form.MappingsSpec$.$anonfun$tests$59(MappingsSpec.scala:109)

This is expected. If you want a value to be reported by assert, assign it to a named val beforehand and use that in the assert.

I forgot about this. It seems ==> suits my need.