Skip to content
This repository has been archived by the owner on Feb 26, 2022. It is now read-only.

Commit

Permalink
Bug 880752 - Fix jetpack tests to account for new stringified output,…
Browse files Browse the repository at this point in the history
… r=Mossop
  • Loading branch information
gijsk authored and Mossop committed Aug 8, 2013
1 parent 85b586b commit a2b5119
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/test-plain-text-console.js
Expand Up @@ -36,15 +36,15 @@ exports.testPlainTextConsole = function(test) {
test.pass("PlainTextConsole instantiates");

con.log('testing', 1, [2, 3, 4]);
test.assertEqual(lastPrint(), "console.log: " + name + ": testing, 1, Array [2,3,4]\n",
test.assertEqual(lastPrint(), "console.log: " + name + ": testing 1 Array [2,3,4]\n",
"PlainTextConsole.log() must work.");

con.info('testing', 1, [2, 3, 4]);
test.assertEqual(lastPrint(), "console.info: " + name + ": testing, 1, Array [2,3,4]\n",
test.assertEqual(lastPrint(), "console.info: " + name + ": testing 1 Array [2,3,4]\n",
"PlainTextConsole.info() must work.");

con.warn('testing', 1, [2, 3, 4]);
test.assertEqual(lastPrint(), "console.warn: " + name + ": testing, 1, Array [2,3,4]\n",
test.assertEqual(lastPrint(), "console.warn: " + name + ": testing 1 Array [2,3,4]\n",
"PlainTextConsole.warn() must work.");

con.error('testing', 1, [2, 3, 4]);
Expand All @@ -64,20 +64,20 @@ exports.testPlainTextConsole = function(test) {
prints = [];

con.log('testing', undefined);
test.assertEqual(lastPrint(), "console.log: " + name + ": testing, undefined\n",
test.assertEqual(lastPrint(), "console.log: " + name + ": testing undefined\n",
"PlainTextConsole.log() must stringify undefined.");

con.log('testing', null);
test.assertEqual(lastPrint(), "console.log: " + name + ": testing, null\n",
test.assertEqual(lastPrint(), "console.log: " + name + ": testing null\n",
"PlainTextConsole.log() must stringify null.");

// TODO: Fix console.jsm to detect custom toString.
con.log("testing", { toString: function() "obj.toString()" });
test.assertEqual(lastPrint(), "console.log: " + name + ": testing, {}\n",
test.assertEqual(lastPrint(), "console.log: " + name + ": testing {}\n",
"PlainTextConsole.log() doesn't printify custom toString.");

con.log("testing", { toString: function() { throw "fail!"; } });
test.assertEqual(lastPrint(), "console.log: " + name + ": testing, {}\n",
test.assertEqual(lastPrint(), "console.log: " + name + ": testing {}\n",
"PlainTextConsole.log() must stringify custom bad toString.");


Expand Down

0 comments on commit a2b5119

Please sign in to comment.