You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Arbitrary.schema: no generation override for a struct's cross-field filter, and lookahead patterns are skipped quietly #10479
arbitraryConstraint cannot say "these two fields agree", and toCodecArbitrary is read only on declarations. In v3, an arbitrary annotation on any schema could replace generation. Could a filter, or any node, take a generation override (an Arbitrary, or a toCodecArbitrary-style link)? Today the workaround is to keep a hand-built Arbitrary next to the schema and pass that to it.prop, so the schema and its generator can drift apart.
The pattern is not compiled for generation, so the generator falls back to random strings and the filter discards all of them. Two asks, either helps: support lookahead (or at least a leading negative lookahead), or throw at derivation with an error that names the pattern it could not compile, instead of the discard error at sample time.
Workaround in use: the same set without a lookahead, isPattern(/^[0-9a-f]{32}$/) plus a filter t !== "0".repeat(32), generates 500 of 500 valid values.
Activity