Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.7.5
-
None
-
None
Description
In the following code
def j = "5" assert 5 == j Assertion failed: assert 5 == j | | | 5 false
it is confusing to understand why assert fails if no types are displayed. Variables compared may be different but their toString() representations used by assert error message may be identical.
Another example I had was:
assert pomSize == project.properties.pomSize | | | | | 2607 | | | 2607 | | [pomSize:2607, gmavenVersion:1.3] | MavenProject: com.goldin:groovymag.listing-1:12.2010 @ E:\Projects\GroovyMag\December-2010\Listing-1\pom.xml false
Here I had a number 2607 on the left, but a String "2607" on the right.
I suggest to add types of variables compared in assert.
Attachments
Issue Links
- relates to
-
GROOVY-7569 PowerAsserts should print results more verbosely and safer
- Closed