Skip to content

Commit 166fcf1

Browse files
committed
Add some counter examples
1 parent e74d0a7 commit 166fcf1

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

test/strings.test.ts

+2-7
Original file line numberDiff line numberDiff line change
@@ -174,18 +174,13 @@ describe('numeric', () => {
174174
test('fuzz', () => {
175175
return fc.assert(
176176
fc.property(fc.anything(), (input) => {
177-
if (
178-
typeof input === 'string' &&
179-
!isNaN(Number(input)) &&
180-
/\S/.test(input) &&
181-
input.trim() === input
182-
) {
177+
if (typeof input === 'string' && /^[0-9]$/.test(input)) {
183178
expect(decoder.verify(input)).toBe(Number(input));
184179
} else {
185180
expect(() => decoder.verify(input)).toThrow();
186181
}
187182
}),
188-
{ examples: [['0 ']] },
183+
{ examples: [['0 '], ['.0'], ['0.'], ['-0'], ['+0']] },
189184
);
190185
});
191186
});

0 commit comments

Comments
 (0)