Maheshjayachandran / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

Unhelpful error from assertEquals #427

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I got the following error message from assertEquals in a test case I'm writing:

Expected <5 characters over the limit> (String) but was <5 characters over the 
limit> (String)

Those are the same string and AFAICT the same type. Closure's testing framework 
needs to do a better job of highlighting what the real problem is.

Original issue reported on code.google.com by collinwi...@google.com on 23 Feb 2012 at 9:43

GoogleCodeExporter commented 9 years ago
A related error message from assertContains:

Expected '5 characters over the limit' to contain '5 characters over'

Original comment by collinwi...@google.com on 23 Feb 2012 at 10:01

GoogleCodeExporter commented 9 years ago
The problem looks to be that Closure is hiding a newline from me. When I use 
Chrome's JS console, this is what the string looks like:

> d[0].innerText
"135 characters
remaining"

Original comment by collinwi...@google.com on 23 Feb 2012 at 10:09

GoogleCodeExporter commented 9 years ago
i was not able to reproduce this. the newline showed up fine for me. it would 
help if you could supply a repro case.

Original comment by Nicholas.J.Santos on 27 Feb 2012 at 10:36

GoogleCodeExporter commented 9 years ago
we checked in some changes to improve the error message. i can't actually 
verify, because i can't repro the issue, but let us know if the changes aren't 
enough.

Original comment by Nicholas.J.Santos on 1 Mar 2012 at 1:01