-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
codeandlearn: use strictEqual instead of equal #10478
Conversation
This looks good but the commit log message needs a bit of fixing up...
EDIT by gibfahn: Cut commit message suggestion to <50 chars |
|
||
var hello = new RegExp('/hello'); | ||
assert.equal(true, hello.exec(server_response) != null); | ||
assert.strictEqual(true, hello.exec(server_response) != null); |
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.
Maybe we can change this assertion and the one below to instead be like:
assert.notEqual(null, hello.exec(server_response));
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.
I agree. Making the changes now.
|
||
var hello = new RegExp('/hello'); | ||
assert.equal(true, hello.exec(server_response) != null); | ||
assert.notEqual(null, hello.exec(server_response)); |
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.
Can you use notStrictEqual()
here.
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.
Ah yes, I missed that it was a regexp so it will always return null
on failure. notStrictEqual()
is better here and below.
|
||
var quit = new RegExp('/quit'); | ||
assert.equal(true, quit.exec(server_response) != null); | ||
assert.notEqual(null, quit.exec(server_response)); |
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.
And here.
@cjihrig .. does this LGTY? |
PR-URL: #10478 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Landed in 3d290d2 |
PR-URL: #10478 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #10478 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #10478 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #10478 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #10478 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #10478 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #10478 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #10478 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #10478 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
Description of change