-
-
Notifications
You must be signed in to change notification settings - Fork 689
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
Added expected regex for when an optional word may be needed in front… #770
Conversation
… of alternative group
@Test | ||
public void translates_alternation_with_optional_words() { | ||
assertPattern( | ||
"the (test )chat/call/email interactions are visible, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need a "
at the end of this line, so there's no compilation error.
The error does look legit. But what's interesting is where it's tripping up is where we half expected it to. Can you move the space one place back so instead of |
Splits the cucumber expression into text, optional, alternative and parameter tokens. This ensures that rewriting optionals does not interfere with rewriting alternatives. Currently processing and splitting is interleaved because the processing step may transform a token back into a text token again after handling its escapes. Fixes: #767 Closes: #770
Change it to |
It's ok. I found the problem already. Given any expression of the form We first rewrite the optionals to regex so we get Then we rewrite the alternatives As you can see after rewriting the optionals we rewrite the alternatives. And because the rewritten optionals ends with |
This is really where colours in markdown would help. Took me 15mins to figure out that regex. But yeh @spatel1009 that is right what you said. That should mitigate (But the original post is still causing some friction I agree) |
Doing it that way with the( test) call/chat/email will only read a Gherkin written as |
I'm not sure I understand
|
Yes I thought so too but I get "cannot find declaration to go to" when using that above. It reads none of the examples you have listed and the only one it reads is: |
This feels like we're finding more edge cases as we go. Ok noted! I'll have a little dabble and liaise up with @mpkorstanje to see if we can add tests for this also. |
Superseded by #771 |
Splits the cucumber expression into text, optional, alternative and parameter tokens. This ensures that rewriting optionals does not interfere with rewriting alternatives. Currently processing and splitting is interleaved because the processing step may transform a token back into a text token again after handling its escapes. Fixes: #767 Closes: #770
Splits the cucumber expression into text, optional, alternative and parameter tokens. This ensures that rewriting optionals does not interfere with rewriting alternatives. Currently processing and splitting is interleaved because the processing step may transform a token back into a text token again after handling its escapes. Fixes: #767 Closes: #770
… of alternative group
cucumber-expression-pattern-test
Summary
Added a test for the expected regex pattern for when an optional word may be needed in front of alternative non-capture group.
Types of changes
No changes or new code has been made towards the app
Checklist: