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 <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
debadree25 authored and danielleadams committed Jul 6, 2023
1 parent e1007ff commit c62e6b2
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 c62e6b2

Please sign in to comment.