Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5a43586

Browse filesBrowse files
debadree25targos
authored andcommitted
test_runner: accept \x1b as a escape symbol
Fixes: #46959 PR-URL: #47050 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 36a026b commit 5a43586
Copy full SHA for 5a43586

File tree

Expand file treeCollapse file tree

2 files changed

+13
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+13
-1
lines changed
Open diff view settings
Collapse file

‎lib/internal/test_runner/tap_lexer.js‎

Copy file name to clipboardExpand all lines: lib/internal/test_runner/tap_lexer.js
+1-1Lines changed: 1 addition & 1 deletion
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) {
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-runner-tap-lexer.js
+12Lines changed: 12 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.