mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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:
committed by
GitHub
parent
8713c83462
commit
d51541b720
@@ -525,7 +525,7 @@ class TapLexer {
|
||||
}
|
||||
|
||||
#isEscapeSymbol(char) {
|
||||
return char === '\\';
|
||||
return char === '\\' || char === '\x1b';
|
||||
}
|
||||
|
||||
#isYamlStartSymbol(char) {
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user