From e701ba4d43f976272c98c06704515b162558651c Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Mon, 14 Oct 2013 16:37:10 -0700 Subject: [PATCH] harness: Truncate messages to one line --- src/test/html/content/harness.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/test/html/content/harness.js b/src/test/html/content/harness.js index a7da6e7cd6e..725380838c2 100644 --- a/src/test/html/content/harness.js +++ b/src/test/html/content/harness.js @@ -1,10 +1,15 @@ +function _oneline(x) { + var i = x.indexOf("\n"); + return (i == -1) ? x : (x.slice(0, i) + "..."); +} + 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); + window.alert(_oneline("TEST-UNEXPECTED" + "-FAIL | " + s + ": " + m)); } function _pass(s, m) { - window.alert("TEST-PASS | " + s + ": " + m); + window.alert(_oneline("TEST-PASS | " + s + ": " + m)); } function is(a, b, c) {