-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
node:test outputs invalid TAP if there is a newline in the test name #45396
Comments
Hey. I would like to work on it. Is it available? |
Is this still available to work on? It's my first issue but I think I should be able to finish it up pretty quickly. |
Yep :) go ahed! |
@MoLow can you assign this issue to me? :) |
@daltonna If you are looking for some
good first issue
|
Hey @MoLow, how can i test changes? |
you can run any test using |
Hey @MoLow, I had tried that create an array like that What do you think about it? Do you have any suggestion for me? |
PR-URL: #45742 Fixes: #45396 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
PR-URL: nodejs#45742 Fixes: nodejs#45396 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
PR-URL: #45742 Fixes: #45396 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
PR-URL: #45742 Fixes: #45396 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
PR-URL: #45742 Fixes: #45396 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
PR-URL: #45742 Fixes: #45396 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
PR-URL: #45742 Fixes: #45396 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
PR-URL: #45742 Fixes: #45396 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
PR-URL: #45742 Fixes: #45396 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
PR-URL: nodejs/node#45742 Fixes: nodejs/node#45396 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> (cherry picked from commit 22dc987fde29734c5bcbb7c33da20d184ff61627)
Version
19.0.1
Platform
Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T8101 arm64
Subsystem
node:test
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Requires a test name with a newline character. Suspect other characters should be escaped as well to prevent problems I stumbled across this when writing something like:
What is the expected behavior?
The
node:test
TAP producer should be robust to test names and produce valid TAP. I would recommend escaping\n
(and probably other) characters when rendering test names to TAP.The output should be:
What do you see instead?
The newline is not escaped. In this case I'm using
not ok
after the newline to drive home the problems as its particularly nasty. The output of the supplied example is:Depending on the contents after any
\n
s in test names, this could result in totally invalid TAP, false diagnostics or misleading TAP output like above.Additional information
it seems that the escaping should also occur in diagnostic serialization code. In the example output above, the newline in the diagnostic was not escaped in the diagnostic either.
Interestingly,
#
seems to be escaped already so:produces good output of:
@nodejs/test_runner
The text was updated successfully, but these errors were encountered: