Skip to content

Commit 4571a1a

Browse files
authoredApr 10, 2022
chore(test): add test for max safe integers in ranges (#450)
Closes #393
1 parent 802e161 commit 4571a1a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎test/fixtures/range-parse.js

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// null result means it's not a valid range
33
// '*' is the return value from functions.validRange(), but
44
// new Range().range will be '' in those cases
5+
const { MAX_SAFE_INTEGER } = require('../../internal/constants')
56
module.exports = [
67
['1.0.0 - 2.0.0', '>=1.0.0 <=2.0.0'],
78
['1.0.0 - 2.0.0', '>=1.0.0-0 <2.0.1-0', { includePrerelease: true }],
@@ -93,4 +94,7 @@ module.exports = [
9394
['>=09090', '>=9090.0.0', true],
9495
['>=09090-0', null, { includePrerelease: true }],
9596
['>=09090-0', null, { loose: true, includePrerelease: true }],
97+
[`^${MAX_SAFE_INTEGER}.0.0`, null],
98+
[`=${MAX_SAFE_INTEGER}.0.0`, `${MAX_SAFE_INTEGER}.0.0`],
99+
[`^${MAX_SAFE_INTEGER - 1}.0.0`, `>=${MAX_SAFE_INTEGER - 1}.0.0 <${MAX_SAFE_INTEGER}.0.0-0`],
96100
]

0 commit comments

Comments
 (0)
Please sign in to comment.