-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
test: add missing newlines to repl .exit writes #58041
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: add missing newlines to repl .exit writes #58041
Conversation
@@ -9,7 +9,8 @@ const r = initRepl(); | |||
|
|||
r.input.emit('data', 'function a() { return 42; } (1)\n'); | |||
r.input.emit('data', 'a\n'); | |||
r.input.emit('data', '.exit'); | |||
r.input.emit('data', '.exit\n'); | |||
r.once('exit', common.mustCall()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this new mustCall
assertion is unnecessary, I can remove it if people don't like this addition
Note: prior to the \n
addition this would cause the test to fail
some tests write `.exit` into a repl server without including a newline character (`\n`), such commands are therefore simply not executed at all, the changes here add the missing newlines and as a side effect remove no longer necessary `end` calls
b51c424
to
e8e2d7a
Compare
Alternatively is preferred the various But I think that keeping them in is the more correct solution 🙂 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #58041 +/- ##
==========================================
- Coverage 90.28% 90.27% -0.01%
==========================================
Files 630 630
Lines 186150 186328 +178
Branches 36468 36510 +42
==========================================
+ Hits 168059 168205 +146
- Misses 10975 11009 +34
+ Partials 7116 7114 -2 🚀 New features to boost your workflow:
|
Landed in 53abd1a |
some tests write `.exit` into a repl server without including a newline character (`\n`), such commands are therefore simply not executed at all, the changes here add the missing newlines and as a side effect remove no longer necessary `end` calls PR-URL: #58041 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
some tests write `.exit` into a repl server without including a newline character (`\n`), such commands are therefore simply not executed at all, the changes here add the missing newlines and as a side effect remove no longer necessary `end` calls PR-URL: #58041 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
some tests write `.exit` into a repl server without including a newline character (`\n`), such commands are therefore simply not executed at all, the changes here add the missing newlines and as a side effect remove no longer necessary `end` calls PR-URL: #58041 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
some tests write `.exit` into a repl server without including a newline character (`\n`), such commands are therefore simply not executed at all, the changes here add the missing newlines and as a side effect remove no longer necessary `end` calls PR-URL: #58041 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
some tests write `.exit` into a repl server without including a newline character (`\n`), such commands are therefore simply not executed at all, the changes here add the missing newlines and as a side effect remove no longer necessary `end` calls PR-URL: #58041 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
some tests write `.exit` into a repl server without including a newline character (`\n`), such commands are therefore simply not executed at all, the changes here add the missing newlines and as a side effect remove no longer necessary `end` calls PR-URL: #58041 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
some tests write `.exit` into a repl server without including a newline character (`\n`), such commands are therefore simply not executed at all, the changes here add the missing newlines and as a side effect remove no longer necessary `end` calls PR-URL: #58041 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
some tests write `.exit` into a repl server without including a newline character (`\n`), such commands are therefore simply not executed at all, the changes here add the missing newlines and as a side effect remove no longer necessary `end` calls PR-URL: #58041 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
some tests write `.exit` into a repl server without including a newline character (`\n`), such commands are therefore simply not executed at all, the changes here add the missing newlines and as a side effect remove no longer necessary `end` calls PR-URL: #58041 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
some tests write `.exit` into a repl server without including a newline character (`\n`), such commands are therefore simply not executed at all, the changes here add the missing newlines and as a side effect remove no longer necessary `end` calls PR-URL: #58041 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
some tests write `.exit` into a repl server without including a newline character (`\n`), such commands are therefore simply not executed at all, the changes here add the missing newlines and as a side effect remove no longer necessary `end` calls PR-URL: #58041 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
I noticed that some repl tests write
".exit"
in the repl, without a newline character (\n
), as far as I can tell such write operations don't have any effect (removing those lines don't cause any test failures (AFAICT)).I'm adding the missing newline characters so that the exit command is actually executed.
As part of this I'm also removing some
end
calls applied to the repl streams that are no longer necessary.