Skip to content

Commit 5a43586

Browse files
debadree25targos
authored andcommitted
test_runner: accept \x1b as a escape symbol
Fixes: #46959 PR-URL: #47050 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 36a026b commit 5a43586

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/internal/test_runner/tap_lexer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ class TapLexer {
525525
}
526526

527527
#isEscapeSymbol(char) {
528-
return char === '\\';
528+
return char === '\\' || char === '\x1b';
529529
}
530530

531531
#isYamlStartSymbol(char) {

test/parallel/test-runner-tap-lexer.js

+12
Original file line numberDiff line numberDiff line change
@@ -480,3 +480,15 @@ ok 1
480480
assert.strictEqual(tokens[index].value, token.value);
481481
});
482482
}
483+
484+
{
485+
const tokens = TAPLexer('\x1b');
486+
487+
[
488+
{ kind: TokenKind.ESCAPE, value: '\x1b' },
489+
{ kind: TokenKind.EOL, value: '' },
490+
].forEach((token, index) => {
491+
assert.strictEqual(tokens[index].kind, token.kind);
492+
assert.strictEqual(tokens[index].value, token.value);
493+
});
494+
}

0 commit comments

Comments
 (0)