lib,test: improve validateNumber and validators coverage#33288
Closed
jasnell wants to merge 2 commits intonodejs:masterfrom
Closed
lib,test: improve validateNumber and validators coverage#33288jasnell wants to merge 2 commits intonodejs:masterfrom
jasnell wants to merge 2 commits intonodejs:masterfrom
Conversation
Adds a min/max predicate to validateNumber (which will be used by the QUIC impl, extracted from that PR) ... and improves test coverage in test-validators.js Signed-off-by: James M Snell <jasnell@gmail.com>
89d8f25 to
9c44e2e
Compare
Collaborator
sam-github
approved these changes
May 7, 2020
Contributor
sam-github
left a comment
There was a problem hiding this comment.
Looks reasonable to me.
cjihrig
approved these changes
May 7, 2020
Member
|
This has a pretty bad performance impact on Buffer functions: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/589/ I just copied the results with a high confidence level. |
BridgeAR
reviewed
May 8, 2020
|
|
||
| [1, false, '', {}, [], 1n, null, undefined].forEach((i) => { | ||
| assert.throws(() => validateBuffer(i, 'foo'), invalidArgTypeError); | ||
| }); |
Member
There was a problem hiding this comment.
Do we need these tests? I suggest to add more "integration" tests instead that test these functions where the code is actually implemented. That way we are certain that the code is properly executed by looking at the coverage report.
Member
Author
|
Closing. Will address a different way in the QUIC code to avoid the perf regression on Buffer. |
3 tasks
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a min/max predicate to validateNumber (which will be used
by the QUIC impl, extracted from that PR) ... and improves test
coverage in test-validators.js
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes