Skip to content

Commit

Permalink
test_runner: accept \x1b as a escape symbol
Browse files Browse the repository at this point in the history
Fixes: #46959
PR-URL: #47050
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
debadree25 authored and targos committed Mar 18, 2023
1 parent 36a026b commit 5a43586
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/test_runner/tap_lexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ class TapLexer {
}

#isEscapeSymbol(char) {
return char === '\\';
return char === '\\' || char === '\x1b';
}

#isYamlStartSymbol(char) {
Expand Down
12 changes: 12 additions & 0 deletions test/parallel/test-runner-tap-lexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}

0 comments on commit 5a43586

Please sign in to comment.