-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
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
Incorrect extracting of {string}
#7
Comments
@tyranron the trouble with this issue is that inside #[given(expr = "{param1} {param2} {param3}")]
fn callback(param1: i32, param2: i32, param3: i32) { ... } So every parameter has to be represented with single capturing group and in case group didn't match we return empty string to avoid messing up the order. We have to provide regex, that will match both Possible solutions to this issue
I like option 2 the most, because it simplifies the matching group, while not contradicting existing vague description of the language. But to be fair actual implementation returns group containing 3 capturing groups: In case of Java, they are handling strings as some kind of special way from what I can tell. This is the only parameter consisting of 2 separate regex groups. |
@ilslv thank you for the clear explanation. We cannot deviate much from what official implementation does, so the option 2 is not an option, unfortunately. So, as the Java implementation does, we should handle |
…, #7) Co-authored-by: Kai Ren <tyranron@gmail.com>
- fix `{string}` parameter returning enclosing quotes (cucumber-rs/cucumber-expressions#7)
@DDtKey this is fixed now in 0.12.0 Additionally, we have extended this case to custom parameters as well. So now, similar patterns where multiple capturing groups are required may be used for them too. |
Thanks for the quick update! 💥 |
In accordance with cucumber-expressions -
{string}
should return only text between quotes.{string}
"banana split"
or'banana split'
(but notbanana split
). Only the text between the quotes will be extracted. The quotes themselves are discarded. Empty pairs of quotes are valid and will be matched and passed to step code as empty strings.But in current version there are quotes in String value
The text was updated successfully, but these errors were encountered: