Skip to content

✨ Add basic maxLength support to stringMatching#6599

Merged
dubzzz merged 17 commits into
mainfrom
regex-max-length-v1
Feb 14, 2026
Merged

✨ Add basic maxLength support to stringMatching#6599
dubzzz merged 17 commits into
mainfrom
regex-max-length-v1

Conversation

@dubzzz

@dubzzz dubzzz commented Feb 13, 2026

Copy link
Copy Markdown
Owner

Description

Re-opening #6285 opened by @emilianbold:

This is a weaker implementation as mentioned in #5562 but one which I think is superior to just adding a filter by hand.

Propagating max downstream means we do contain a bit better performance wise though we still need to filter the final result.

Also explored min but that seemed less valuable than containing max better.

Reworked the initial PR to fit review.

ChecklistDon't delete this checklist and make sure you do the following before opening the PR

  • The name of my PR follows gitmoji specification
  • My PR references one of several related issues (if any)
    • New features or breaking changes must come with an associated Issue or Discussion
    • My PR does not add any new dependency without an associated Issue or Discussion
  • My PR includes bumps details, please run pnpm run bump and flag the impacts properly
  • My PR adds relevant tests and they would have failed without my PR (when applicable)

Advanced

  • Category: ...
  • Impacts: ...

@changeset-bot

changeset-bot Bot commented Feb 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8b5f8c8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
fast-check Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dubzzz dubzzz changed the title ✨ Add maxLength support to stringMatching ✨ Add basic maxLength support to stringMatching Feb 13, 2026
Comment thread packages/fast-check/src/arbitrary/stringMatching.ts Outdated
@pkg-pr-new

pkg-pr-new Bot commented Feb 13, 2026

Copy link
Copy Markdown
@fast-check/ava

npm i https://pkg.pr.new/@fast-check/ava@6599

fast-check

npm i https://pkg.pr.new/fast-check@6599

@fast-check/jest

npm i https://pkg.pr.new/@fast-check/jest@6599

@fast-check/packaged

npm i https://pkg.pr.new/@fast-check/packaged@6599

@fast-check/poisoning

npm i https://pkg.pr.new/@fast-check/poisoning@6599

@fast-check/vitest

npm i https://pkg.pr.new/@fast-check/vitest@6599

@fast-check/worker

npm i https://pkg.pr.new/@fast-check/worker@6599

commit: 8b5f8c8

Comment thread website/docs/core-blocks/arbitraries/combiners/string.md Outdated
@dubzzz
dubzzz enabled auto-merge (squash) February 14, 2026 09:28
@github-actions

Copy link
Copy Markdown
Contributor

@dubzzz
dubzzz merged commit 38926bb into main Feb 14, 2026
48 checks passed
@dubzzz
dubzzz deleted the regex-max-length-v1 branch February 14, 2026 09:34
@codecov

codecov Bot commented Feb 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.00000% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.61%. Comparing base (d4c4523) to head (8b5f8c8).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../src/arbitrary/_internals/helpers/ClampRegexAst.ts 71.79% 11 Missing ⚠️
...ackages/fast-check/src/arbitrary/stringMatching.ts 77.77% 2 Missing ⚠️
packages/fast-check/src/utils/noSuchValue.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6599      +/-   ##
==========================================
- Coverage   94.84%   94.61%   -0.23%     
==========================================
  Files         207      209       +2     
  Lines        5584     5631      +47     
  Branches     1471     1493      +22     
==========================================
+ Hits         5296     5328      +32     
- Misses        275      290      +15     
  Partials       13       13              
Flag Coverage Δ
tests 94.61% <70.00%> (-0.23%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants