test_runner: accept \x1b as a escape symbol

Fixes: https://github.com/nodejs/node/issues/46959
PR-URL: https://github.com/nodejs/node/pull/47050
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Debadree Chatterjee
2023-03-17 02:09:36 +05:30
committed by GitHub
parent 8713c83462
commit d51541b720
2 changed files with 13 additions and 1 deletions

View File

@@ -525,7 +525,7 @@ class TapLexer {
}
#isEscapeSymbol(char) {
return char === '\\';
return char === '\\' || char === '\x1b';
}
#isYamlStartSymbol(char) {

View File

@@ -480,3 +480,15 @@ ok 1
assert.strictEqual(tokens[index].value, token.value);
});
}
{
const tokens = TAPLexer('\x1b');
[
{ kind: TokenKind.ESCAPE, value: '\x1b' },
{ kind: TokenKind.EOL, value: '' },
].forEach((token, index) => {
assert.strictEqual(tokens[index].kind, token.kind);
assert.strictEqual(tokens[index].value, token.value);
});
}