Skip to content

fix(number): values out of bounds#1648

Merged
ST-DDT merged 2 commits into
nextfrom
fix/number/out-of-bounds
Dec 10, 2022
Merged

fix(number): values out of bounds#1648
ST-DDT merged 2 commits into
nextfrom
fix/number/out-of-bounds

Conversation

@ST-DDT

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

Copy link
Copy Markdown
Member

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

codecov Bot commented Dec 9, 2022

Copy link
Copy Markdown

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
Comment thread test/number.spec.ts
@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

4 participants