Skip to content

Commit 4571a1a

Browse files
authored
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

Lines changed: 4 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy