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.
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
Added Exact Value/s Condition for String Length & Tests required with README.md Update #2019
Added Exact Value/s Condition for String Length & Tests required with README.md Update #2019
Changes from 28 commits
ae711d6
f93cf70
cdd2192
27a40c8
cf729d1
be706c4
db5b0c7
2e48053
c194526
21ec415
59abfc7
e1bb810
7c2c0cf
3ee58c0
d3e6ca5
b850b84
acfe071
cdb06a5
70775b4
a71b7ff
dc42e7f
fb0def3
ec1aa91
73dc505
c7605bc
93ac65f
bc693dc
a90171f
57a5633
642e603
bb02daf
2a0a428
1bf1ee4
9fd65ed
fd90691
d09738c
11aa19f
e63e7a5
3ef2588
3b5cbd9
2897ef9
22bb2f0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
What would happen if one of the
exact
numbers is lower thanmin
or higher thanmax
? Should we add tests for that behaviour as well?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.
Since the
exact
condition only runs when the Length of the String falls inside[min, max]
range, if at allexact
integer or one of theexact
numbers is out of range[min, max]
, the equality check for that case will returnfalse
andisValid
won't be set totrue
.Also, I have included the test condition for that behavior in the already present test with
args: [{ min: 5, max: 10, exact: [2, 6, 8, 9] }]
.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.
We can remove this test since it tests the same as the test of
{ exact: 2 }
.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.
Or adjust this test to test the combination of a
min
andexact
values.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.
Actually, the later one with
exact: { first: 6, second: 8, third: 9 }
checks for the condition involving theexact
being an object. Hence, I have adjusted the previous one with{exact: 2}
to test the combination of amin
andexact
values.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 was wrong about this test, the difference is that this is using a string of '9' instead of the number 9. That makes this a different test to
{ exact: 2 }
. So the combination ofmin
andexact
should be an additional testThere 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.
So I have included the combination of a
min
andexact
values in a test withargs: [{ min: 1, exact: 2 }]
.