test: change equal to strictEqual in path tests#8628
test: change equal to strictEqual in path tests#8628lrlna wants to merge 2 commits intonodejs:masterfrom
Conversation
test/parallel/test-path.js
Outdated
| const controlCharFilename = 'Icon' + String.fromCharCode(13); | ||
| assert.equal(path.posix.basename('/a/b/' + controlCharFilename), | ||
| assert.strictEqual(path.posix.basename('/a/b/' + controlCharFilename), | ||
| controlCharFilename); |
There was a problem hiding this comment.
could you try and align the arguments here and in cases like this? :)
Fishrock123
left a comment
There was a problem hiding this comment.
Seems fine other than some alignment issues.
@lrlna can you try running make -j4 lint? I think it should catch these... maybe not though.
I don't think this should cause too many conflicts as I'm not aware of any major changes to path recently.
test/parallel/test-path.js
Outdated
| assert.strictEqual(path.win32.dirname('\\\\unc\\share\\foo\\'), | ||
| '\\\\unc\\share\\'); | ||
| assert.strictEqual(path.win32.dirname('\\\\unc\\share\\foo\\bar'), | ||
| '\\\\unc\\share\\foo'); |
test/parallel/test-path.js
Outdated
| '\\\\unc\\share\\foo'); | ||
| assert.equal(path.win32.dirname('\\\\unc\\share\\foo\\bar\\baz'), | ||
| assert.strictEqual(path.win32.dirname('\\\\unc\\share\\foo\\bar\\baz'), | ||
| '\\\\unc\\share\\foo\\bar'); |
|
@Fishrock123 The linter does not catch this, and I think weβve talked about maybe enabling a rule like that, soβ¦ @Trott? |
|
I implemented the |
|
Quick implementation suggests enabling alignment for this situation will find around 66 alignment problems in the existing code base. That sounds like the upper edge of acceptable churn for something like this to me so I'll put together a PR. @Irina, if you could align the instances this PR, that would be great. Sorry we didn't have a lint rule in place to catch it before it got submitted as a PR. |
|
@Trott I think itβs worth it because usually someone will point out those misalignmentsβ¦ maybe wait a couple of days, though. π |
|
(There will still be lots of alignment issues that the rule doesn't catch but I'm OK with slowly ratcheting it up over time rather than all at once.) |
|
@addaleax @Fishrock123 Here's a PR with the alignment linting: #8642 |
|
howdy, apologies for disappearing! Miss-alignments have been fixed and pushed π― |
A few nits in recent PR comments suggest that we can have slightly more strict linting for argument alignment in multiline function calls. This enables the existing linting requirements to apply when one or more of the arguments themselves are function calls. Previously, that situation had been excluded from linting. Refs: nodejs#8628 (comment) PR-URL: nodejs#8642 Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
PR-URL: #8628 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
|
Landed in daa0f90! thank you! |
|
omg YAY! π |
A few nits in recent PR comments suggest that we can have slightly more strict linting for argument alignment in multiline function calls. This enables the existing linting requirements to apply when one or more of the arguments themselves are function calls. Previously, that situation had been excluded from linting. Refs: #8628 (comment) PR-URL: #8642 Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
PR-URL: #8628 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Checklist
make -j4 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
tests
Description of change
Use strict equality in
test-pathset of unit tests.