Repository navigation
Tap escaping not consistent with and without --test #45836
Copy link
Copy link
Closed
Labels
good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
Description
Activity
- addedgood first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
on Dec 13, 2022 @MoLow could you guide which relevant files I could look into, can take a stab at this
I am not sure where the exact issue is, but these can be good places to start the investigation
node/lib/internal/test_runner/tap_stream.js
Lines 133 to 143 in 0429774
function tapEscape(input) { let result = StringPrototypeReplaceAll(input, '\\', '\\\\'); result = StringPrototypeReplaceAll(result, '#', '\\#'); result = StringPrototypeReplaceAll(result, '\b', '\\b'); result = StringPrototypeReplaceAll(result, '\f', '\\f'); result = StringPrototypeReplaceAll(result, '\t', '\\t'); result = StringPrototypeReplaceAll(result, '\n', '\\n'); result = StringPrototypeReplaceAll(result, '\r', '\\r'); result = StringPrototypeReplaceAll(result, '\v', '\\v'); return result; }
node/lib/internal/test_runner/tap_parser.js
Lines 360 to 362 in 0429774
if (nextToken.kind !== TokenKind.ESCAPE) { ArrayPrototypePush(literals, word); } also
node/lib/internal/test_runner/tap_lexer.js
Line 515 in 0429774
#isEscapeSymbol(char) { Thank you so much looking into it!
Reacted by Moshe Atlow$ node --test test.js TAP version 13 # Subtest: /test/test.js ok 1 - /test.js --- duration_ms: 0.036416797 ... 1..1 # tests 1 # pass 1 # fail 0 # cancelled 0 # skipped 0 # todo 0 # duration_ms 0.079281594Has this been fixed, here's the output which I get?
Reacted by Debadree Chatterjee and Steven@manekinekko any ideas here?
- added a commit that references this issue
on Jan 28, 2023 - added a commit that references this issue
on Feb 1, 2023 - added 2 commits that reference this issue
on Feb 7, 2023 - added 2 commits that reference this issue
on Mar 3, 2023
Metadata
Metadata
Assignees
Labels
good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
Version
v20.0.0-pre
Platform
Darwin Moshes-MBP.localdomain 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:01 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T6000 arm64
Subsystem
test_runner
What steps will reproduce the bug?
create test.js
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior?
when running without
--test:node test.jsWhat do you see instead?
when running with
--testnode --test test.jsAdditional information
No response