Skip to content

Commit 114b57d

Browse files
committed
chore: better values for benchmark of parse
1 parent 637d76b commit 114b57d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

benchmarks/bench-parse.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@
22

33
const Benchmark = require('benchmark')
44
const parse = require('../functions/parse')
5-
const { MAX_SAFE_INTEGER } = require('../internal/constants')
65
const suite = new Benchmark.Suite()
76

8-
const cases = ['1.2.1', '1.2.2-4', '1.2.3-pre']
9-
const invalidCases = [`${MAX_SAFE_INTEGER}0.0.0`, 'hello, world', 'xyz']
7+
const cases = require(`../test/fixtures/valid-versions`)
8+
const invalidCases = require(`../test/fixtures/invalid-versions`)
109

1110
for (const test of cases) {
12-
suite.add(`parse(${test})`, function () {
13-
parse(test)
11+
suite.add(`parse(${test[0]})`, function () {
12+
parse(test[0])
1413
})
1514
}
1615

1716
for (const test of invalidCases) {
18-
suite.add(`invalid parse(${test})`, function () {
19-
parse(test)
17+
suite.add(`invalid parse(${test[0]})`, function () {
18+
parse(test[0])
2019
})
2120
}
2221

0 commit comments

Comments
 (0)