Uh oh!
There was an error while loading. Please reload this page.
test_runner: allow special characters in snapshot keys - #57017
Conversation
nodejs-github-bot
commented
Feb 12, 2025
Review requested:
|
Ceres6
commented
Feb 12, 2025
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## main #57017 +/- ##
==========================================
- Coverage 89.15% 89.07% -0.09%
==========================================
Files 665 665 Lines 192798 193312 +514 Branches 37130 37263 +133 ==========================================
+ Hits 171886 172187 +301 - Misses 13673 13829 +156 - Partials 7239 7296 +57
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Since this appears to duplicate much of templateEscape(), couldn't we do this instead: keyEscape(templateEscape(id))
There was a problem hiding this comment.
I tried it but then it starts failing as we over-escape things, the problem is with the \\ to \\\\ replace
There was a problem hiding this comment.
I think the bug happens while reading the snapshots back. I think for this case, it would be better to test a full round trip (write the file and then read it back) using the public APIs. It would probably be good to check a couple more cases besides just \r since in #56836 (comment), it was reported that this happens for a range of inputs (not saying we should test every single input though).
There was a problem hiding this comment.
The test was failing before the check, but I will add an e2e test
There was a problem hiding this comment.
AFAICS the range in that comment is the block of high surrogate and low surrogate pairs which are reserved for utf-16 and shouldn't appear, but I'm not an expert on this, so not sure
targos
commented
Feb 14, 2025
There's a typo in the commit message: especial -> special |
aduh95
commented
Feb 15, 2025
Also, the subsystem should be |
b91c14b to
06b3b94CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
db614e3 to
02bbd1dCompare
This comment was marked as outdated.
This comment was marked as outdated.
nodejs-github-bot
commented
Feb 18, 2025
nodejs-github-bot
commented
Feb 19, 2025
Landed in baa60ce |
Fixes: nodejs#56836 PR-URL: nodejs#57017 Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Use
JSONStringifyto serialise snapshot keys to allow special characters such as\rto be used in test namesFixes: #56836