Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 24 by
ro...@google.com: Output from expectThat after "Actual:" is
usually unreadable for anything but the simplest objects.
http://code.google.com/p/google-js-test/issues/detail?id=24
Output from expectThat after "Actual:" is usually unreadable for anything
but the simplest objects.
Test code using google-js-test has very nice control over what is printed
out immediately after "Expected:", but has very little control over what
gets printed out immediately after "Actual:". I would expect
that "Actual:" would use the matcher's negativeDescription field in a
manner similar to the way "Expected:" uses the matcher's description
field. Instead, expectThat uses its own "stringify" function that prints
out mostly garbage for complex objects.
I don't see where negativeDescription gets used anywhere. Is it? If not,
what's its purpose? If it is intended for another purpose, then there
should be another non-intrusive mechanism for test code to control what
gets printed out after "Actual:" that operates similarly to "Expected:".
Below is an example from some output from a test that I'm running. For
the "Expected:" output, I convert my object to a flat array and insert it
into the Matcher's description field. I do a similar thing for the
negativeDescription field, but it has no effect.
Expected: is a camera with elements matching: [1000,15,25,0,1024,640,60]
Actual: { data_: [ [ 10, 0, 0 ], [ 15, 25, 0 ], [ 1024, 640 ], 60 ],
getMessageDescriptor: function (), serializeAsQueryString: function (),
copyFrom: function (other), toArray: function (), copyToArray: function (),
hasFieldOfViewY: function (), getFieldOfViewY: function (),
setFieldOfViewY: function (x), clearFieldOfViewY: function (), hasLocation:
function (), getLocation: function (), mutableLocation: function (),
clearLocation: function (), hasRotation: function (), getRotation: function
(), mutableRotation: function (), clearRotation: function (),
hasScreenSize: function (), getScreenSize: function (), mutableScreenSize:
function (), clearScreenSize: function () }, whose altitude doesn't match