Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_runner: accept \x1b as a escape symbol #47050

Merged
merged 2 commits into from Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/internal/test_runner/tap_lexer.js
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
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);
});
}