Skip to content
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

fix(number): values out of bounds #1648

Merged
merged 2 commits into from
Dec 10, 2022
Merged

fix(number): values out of bounds #1648

merged 2 commits into from
Dec 10, 2022

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Dec 9, 2022

Fixes: #1595

This PR fixes the issue caused by number.int returning values out of bounds, if the given min and max aren't integers themselves.
This also causes number.float to return values out of bounds.

Case 1: int({min: 2.1, max: 2.9})

Previously -> 2 or 3
Now -> Error

Case 2: int({min: 1.1, max: 2.9})

Previously -> 1, 2 or 3
Now -> 2

@ST-DDT ST-DDT added c: bug Something isn't working p: 2-high Fix main branch s: accepted Accepted feature / Confirmed bug m: number Something is referring to the number module labels Dec 9, 2022
@ST-DDT ST-DDT added this to the v8.0 - Module Re-Shuffling milestone Dec 9, 2022
@ST-DDT ST-DDT requested a review from a team as a code owner December 9, 2022 12:46
@ST-DDT ST-DDT self-assigned this Dec 9, 2022
@codecov
Copy link

codecov bot commented Dec 9, 2022

Codecov Report

Merging #1648 (089c6b6) into next (e181150) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #1648   +/-   ##
=======================================
  Coverage   99.62%   99.63%           
=======================================
  Files        2222     2222           
  Lines      240507   240514    +7     
  Branches     1067     1073    +6     
=======================================
+ Hits       239605   239636   +31     
+ Misses        881      857   -24     
  Partials       21       21           
Impacted Files Coverage Δ
src/modules/number/index.ts 100.00% <100.00%> (ø)
src/modules/internet/user-agent.ts 90.54% <0.00%> (+6.48%) ⬆️

@Shinigami92 Shinigami92 added p: 1-normal Nothing urgent and removed p: 2-high Fix main branch labels Dec 9, 2022
test/number.spec.ts Show resolved Hide resolved
@ST-DDT ST-DDT requested review from a team December 9, 2022 13:22
@Shinigami92 Shinigami92 requested a review from a team December 9, 2022 14:01
@ST-DDT ST-DDT enabled auto-merge (squash) December 10, 2022 09:32
@ST-DDT ST-DDT merged commit e4839a9 into next Dec 10, 2022
@ST-DDT ST-DDT deleted the fix/number/out-of-bounds branch December 11, 2022 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: bug Something isn't working m: number Something is referring to the number module p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Number functions can generate values out of bound
4 participants