Improve visual presentation in the case where test string contains '\n'.

This commit is contained in:
pschwartau%netscape.com 2001-09-14 20:10:49 +00:00
Родитель 4edb1e1b3f
Коммит 625129bd11
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -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));
}