Skip to content

Commit

Permalink
style: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed May 29, 2022
1 parent b18c687 commit de5b63d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,15 @@ test('invalid version does not cause catatrophic backtracking', t => {
// Note reproduces attack string generated by https://devina.io/redos-checker
const start = Date.now();
const fixtures = [
'0.0.1-i' + '--i-'.repeat(index) + '\x00',
'0.0.1-i' + '--i-'.repeat(index) + '\u0000',
'0' + ' 0.1.0-i0'.repeat(index) + '.1.1+1' + '1'.repeat(index) + 'A',
'1.0.1--' + '-'.repeat(index) + '\x00',
'g' + ' 0.0.1-i+'.repeat(index) + 'a' + 'v0'.repeat(index) + '\x00'
]
fixtures.forEach((fixture) => semverRegex().test(fixture));
'1.0.1--' + '-'.repeat(index) + '\u0000',
'g' + ' 0.0.1-i+'.repeat(index) + 'a' + 'v0'.repeat(index) + '\u0000',
];
for (const fixture of fixtures) {
semverRegex().test(fixture);
}

const difference = Date.now() - start;
t.true(difference < 20, `Execution time: ${difference}`);
}
Expand Down

0 comments on commit de5b63d

Please sign in to comment.