diff --git a/.changeset/clear-astral-ranges.md b/.changeset/clear-astral-ranges.md new file mode 100644 index 000000000..4675cd119 --- /dev/null +++ b/.changeset/clear-astral-ranges.md @@ -0,0 +1,5 @@ +--- +"fast-check": patch +--- + +🐛 Shrink Unicode regex character ranges using complete code points diff --git a/packages/fast-check/src/arbitrary/stringMatching.ts b/packages/fast-check/src/arbitrary/stringMatching.ts index 6c1af7e1d..0f65c1a37 100644 --- a/packages/fast-check/src/arbitrary/stringMatching.ts +++ b/packages/fast-check/src/arbitrary/stringMatching.ts @@ -179,7 +179,7 @@ function toMatchingArbitrary( if (typeof c !== 'string') throw new Error('Invalid type'); if ([...c].length !== 1) throw new Error('Invalid length'); // oxlint-disable-next-line typescript/no-non-null-assertion - return c.charCodeAt(0)!; + return c.codePointAt(0)!; }, ); }