function _fail(s, m) {
  // string split to avoid problems with tests that end up printing the value of window._fail.
  window.alert("TEST-UNEXPECTED" + "-FAIL | " + s + ": " + m);
}

function _pass(s, m) {
  window.alert("TEST-PASS | " + s + ": " + m);
}

function is(a, b, c) {
  let f = a != b ? _fail : _pass;
  let m = !c ? "" : c;
  f(a + " == " + b, m);
}

function isnot(a, b, c) {
  let f = (a != b) ? _pass : _fail;
  let m = !c ? "" : c;
  f(a + " != " + b, m);
}

var _test_complete = false;
var _test_timeout = 10000; //10 seconds
function finish() {
  _test_complete = true;
  window.close();
}

function _test_timed_out() {
  if (!_test_complete) {
    _fail('test timed out (' + _test_timeout/1000 + 's)');
    finish();
  }
}

setTimeout(_test_timed_out, _test_timeout);

@@ -1,16 +1,119 @@
+function _oneline(x) %7B%0A  var i = x.indexOf(%22%5Cn%22);%0A  return (i == -1) ? x : (x.slice(0, i) + %22...%22);%0A%7D%0A%0A
 function _fail(s
@@ -225,24 +225,33 @@
 indow.alert(
+_oneline(
 %22TEST-UNEXPE
@@ -276,32 +276,33 @@
  + s + %22: %22 + m)
+)
 ;%0A%7D%0A%0Afunction _p
@@ -328,16 +328,25 @@
 w.alert(
+_oneline(
 %22TEST-PA
@@ -367,16 +367,17 @@
 : %22 + m)
+)
 ;%0A%7D%0A%0Afun

Truncate messages to one line