XPCShell test output changes
13 June, 2013 § Leave a comment
Those of you using XPCShell tests may notice some slightly improved output from the test macros that landed recently on mozilla-central.
Previously, if you called do_check_null(null)
, you would get an output that was similar to:
[TEST-PASS] null == null
However, if you tried do_check_null("null")
, you would get an output that was similar to:
[TEST-FAIL] null == null
This isn’t very helpful, and I ran into this exact issue while working on some code that uses observers. Since the data is passed as JSON, when JSON.stringify(null)
is called the result is “null”. The test runner showing null == null
as a failure isn’t too helpful 😛
With this recent change, all string arguments will be adorned with double-quotes.
This means that calling do_check_null("null")
will now output:
[TEST-FAIL] "null" == null
The same change was made for all of the other do_check_*
and do_print
macros.
Leave a Reply