Skip to content

Commit

Permalink
chore(test): add test for max safe integers in ranges (#450)
Browse files Browse the repository at this point in the history
Closes #393
  • Loading branch information
lukekarrys authored Apr 10, 2022
1 parent 802e161 commit 4571a1a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/fixtures/range-parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// null result means it's not a valid range
// '*' is the return value from functions.validRange(), but
// new Range().range will be '' in those cases
const { MAX_SAFE_INTEGER } = require('../../internal/constants')
module.exports = [
['1.0.0 - 2.0.0', '>=1.0.0 <=2.0.0'],
['1.0.0 - 2.0.0', '>=1.0.0-0 <2.0.1-0', { includePrerelease: true }],
Expand Down Expand Up @@ -93,4 +94,7 @@ module.exports = [
['>=09090', '>=9090.0.0', true],
['>=09090-0', null, { includePrerelease: true }],
['>=09090-0', null, { loose: true, includePrerelease: true }],
[`^${MAX_SAFE_INTEGER}.0.0`, null],
[`=${MAX_SAFE_INTEGER}.0.0`, `${MAX_SAFE_INTEGER}.0.0`],
[`^${MAX_SAFE_INTEGER - 1}.0.0`, `>=${MAX_SAFE_INTEGER - 1}.0.0 <${MAX_SAFE_INTEGER}.0.0-0`],
]

0 comments on commit 4571a1a

Please sign in to comment.