Skip to content
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

cucumber-expressions: Handle multiple capture group regexps for matching #102

Merged
merged 1 commit into from Jan 19, 2017

Conversation

gpichot
Copy link
Contributor

@gpichot gpichot commented Jan 16, 2017

Summary

When creating a new transform with multiple capture group regexps, cucumber fail to match expressions that are not using the first capturing regexp.

For instance, a transform with the captureGroupRegexps with the value ['red', 'yellow'] would fail to match an expression containing yellow.

Details

The matching expression is now a disjonction of all the capturing regexps using non capturing group (with (?:...)).

Motivation and Context

I had an issue when using multiple regexps for the same transform as it was only matching the first one. This commit fix it.

How Has This Been Tested?

I added one test that use the second regexp of the captureGroupRegexps option of a transform (and that is not matching a subset of the first regexp).

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

Checklist:

  • I've added tests for my code.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@aslakhellesoy aslakhellesoy changed the title Handle multiple capture group regexps for matching [cucumber-expressions] Handle multiple capture group regexps for matching Jan 18, 2017
@aslakhellesoy aslakhellesoy added cucumber-expressions ⚡ enhancement Request for new functionality labels Jan 18, 2017
@aslakhellesoy
Copy link
Contributor

Thanks for this! I'll merge it as after I've implemented a Java and Ruby implementation too.

@aslakhellesoy aslakhellesoy merged commit 5b391f8 into cucumber:master Jan 19, 2017
aslakhellesoy added a commit that referenced this pull request Jan 19, 2017
@aslakhellesoy
Copy link
Contributor

What a great patch @gpichot - really well done.

@gpichot
Copy link
Contributor Author

gpichot commented Jan 20, 2017

Thanks for the merge @aslakhellesoy ! :)

@mattwynne mattwynne changed the title [cucumber-expressions] Handle multiple capture group regexps for matching cucumber-expressions: Handle multiple capture group regexps for matching Mar 4, 2017
@lock
Copy link

lock bot commented Oct 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
⚡ enhancement Request for new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants