FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: refactor test-crypto-timing-safe-equal by targos · Pull Request #9843 · nodejs/node · GitHub

/ node Public

test: refactor test-crypto-timing-safe-equal - #9843

Closed
targos wants to merge 1 commit into
nodejs:masterfrom
targos:refactor-test-crypto-timing
Closed

test: refactor test-crypto-timing-safe-equal#9843
targos wants to merge 1 commit into
nodejs:masterfrom
targos:refactor-test-crypto-timing

Conversation

targos commented Nov 29, 2016
edited
Loading

Copy link
Copy Markdown
Member
Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test, crypto

Description of change

Add RegExp arguments to throws assertions.

CI: https://ci.nodejs.org/job/node-test-pull-request/5023/

Add RegExp arguments to throws assertions.
targos added crypto Issues and PRs related to the crypto subsystem. test Issues and PRs related to the tests. labels Nov 29, 2016

Trott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM if CI is ✅

You may already be thinking along these lines, but perhaps when you're done with all of these, we can create a lint rule that prohibits a string for the second argument of assert.throws() since it is usually an error and (in cases like this file) when it is not an error, the assertion is still probably better with a constructor, RegExp, or validation function added.

targos commented Nov 29, 2016

Copy link
Copy Markdown
Member Author

@Trott: targos@8909496 ;)

not-an-aardvark left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

crypto.timingSafeEqual(Buffer.from([1, 2, 3]), Buffer.from([1, 2]));
}, 'should throw when given buffers with different lengths');
}, /^TypeError: Input buffers must have the same length$/,
'should throw when given buffers with different lengths');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is indentation ok? It seems off by one.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I don't really know... I aligned the arguments together.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Seems right to me. I think it's just a visual effect because of the / and the '.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@gibfahn I'm fine with this but there are 3 spaces not 2.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yes, but that's to align with the }, on the previous line right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The ' should be aligned with the c of crypto but it doesn't matter, there is no need to waste time over this nit 😄

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Actually rereading @targos comment above I think this correct, so ignore me :)

targos commented Dec 1, 2016

Copy link
Copy Markdown
Member Author

Landed in cf71915

targos closed this Dec 1, 2016
targos deleted the refactor-test-crypto-timing branch December 1, 2016 17:41
targos added a commit that referenced this pull request Dec 1, 2016
Add RegExp arguments to throws assertions.

PR-URL: #9843
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
addaleax pushed a commit that referenced this pull request Dec 5, 2016
Add RegExp arguments to throws assertions.

PR-URL: #9843
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Fishrock123 mentioned this pull request Dec 5, 2016
2 tasks
addaleax pushed a commit to addaleax/node that referenced this pull request Dec 8, 2016
Add RegExp arguments to throws assertions.

PR-URL: nodejs#9843
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
jmdarling pushed a commit to jmdarling/node that referenced this pull request Dec 8, 2016
Add RegExp arguments to throws assertions.

PR-URL: nodejs#9843
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 21, 2016
Add RegExp arguments to throws assertions.

PR-URL: #9843
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
MylesBorins mentioned this pull request Dec 21, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crypto Issues and PRs related to the crypto subsystem. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL