We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Matchers (pact-js):
'hydra:member': eachLike({ 'family': { 'pact:matcher:type': 'regex', 'pact:generator:type': 'Regex', regex: '^\/api\/families\/[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$', }, 'gender': { 'pact:matcher:type': 'regex', 'pact:generator:type': 'Regex', regex: '(male|female|other)', } })
While the generator for the field gender worked, the generator for the field family panic then stop the mock server.
gender
family
Log:
2023-08-10T05:09:46.588700Z DEBUG tokio-runtime-worker pact_models::generators: Applying generator Regex("(male|female|other)") to key $['hydra:member'][*].gender 2023-08-10T05:09:46.588718Z DEBUG tokio-runtime-worker pact_models::generators: Generating value from Regex("(male|female|other)") context={"mockServer": Object {"port": Number(36037), "url": String("http://127.0.0.1:36037")}} 2023-08-10T05:09:46.588748Z DEBUG tokio-runtime-worker pact_models::generators: Generated value = Ok(String("other")) 2023-08-10T05:09:46.588751Z DEBUG tokio-runtime-worker pact_models::generators: Applying generator Regex("^/api/families/[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$") to key $['hydra:member'][*].family 2023-08-10T05:09:46.588761Z DEBUG tokio-runtime-worker pact_models::generators: Generating value from Regex("^/api/families/[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$") context={"mockServer": Object {"port": Number(36037), "url": String("http://127.0.0.1:36037")}} thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Anchor', /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/pact_models-1.1.9/src/generators/mod.rs:1041:60
Info:
The text was updated successfully, but these errors were encountered:
Looks like rand_regex crate does not support anchors in the regex
Returns an error if the Hir object contains anchors (^, $, \A, \z) or word boundary assertions (\b, \B).
Sorry, something went wrong.
I tried remove anchors ^ and $ and it work fine. Should I keep this issue or close it as won't fix?
^
$
It needs to be fixed, it shouldn't ever just panic
fix: Regex generator panics if the regex has any anchors #311
e9f7c06
No branches or pull requests
Matchers (pact-js):
While the generator for the field
gender
worked, the generator for the fieldfamily
panic then stop the mock server.Log:
Info:
The text was updated successfully, but these errors were encountered: