Enable to pass a test message.

This commit is contained in:
Tetsuharu OHZEKI 2013-09-19 04:39:53 +09:00
parent e576a1cf7e
commit 795c07209b

View file

@ -1,15 +1,16 @@
function _fail(s) { function _fail(s, m) {
// string split to avoid problems with tests that end up printing the value of window._fail. // string split to avoid problems with tests that end up printing the value of window._fail.
window.alert("TEST-UNEXPECTED" + "-FAIL | " + s); window.alert("TEST-UNEXPECTED" + "-FAIL | " + s + ": " + m);
} }
function _pass(s) { function _pass(s, m) {
window.alert("TEST-PASS | " + s); window.alert("TEST-PASS | " + s + ": " + m);
} }
function is(a, b) { function is(a, b, c) {
let f = a != b ? _fail : _pass; let f = a != b ? _fail : _pass;
f(a + " == " + b); let m = !c ? "" : c;
f(a + " == " + b, m);
} }
var _test_complete = false; var _test_complete = false;