From 625129bd11aeb1960c89112ae6b82644b8f88342 Mon Sep 17 00:00:00 2001 From: "pschwartau%netscape.com" Date: Fri, 14 Sep 2001 20:10:49 +0000 Subject: [PATCH] Improve visual presentation in the case where test string contains '\n'. --- js/tests/ecma_3/RegExp/shell.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/tests/ecma_3/RegExp/shell.js b/js/tests/ecma_3/RegExp/shell.js index f565488805b5..f316d36566fd 100644 --- a/js/tests/ecma_3/RegExp/shell.js +++ b/js/tests/ecma_3/RegExp/shell.js @@ -125,8 +125,13 @@ function testRegExp(statuses, patterns, strings, actualmatches, expectedmatches) function getState(status, pattern, string) { + /* + * Escape \n's to make them LITERAL \n's in the presentation string. + * We don't have to worry about this in |pattern|; such escaping is + * done automatically by pattern.toString(), invoked implicitly below. + */ + string = string.replace(/\n/g, '\\n'); return (status + MSG_PAT + pattern + MSG_STR + quote(string)); - }