Skip to content

Conversation

@304NotModified
Copy link
Member

@304NotModified 304NotModified commented Jul 4, 2025

🤔 What's changed?

Prefix regex with ^ to ensure that it's detected as regex instead of a cucumber expression.

⚡️ What's your motivation?

Otherwise the expressions are sometimes interpreted as cucumber expression at runtime, which isn't correct

🏷️ What kind of change is this?

  • ⚡ New feature (non-breaking change which adds new behaviour)

📋 Checklist:

  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "[vNext]" section of the CHANGELOG, linking to this pull request & included my GitHub handle to the release contributors list.

This text was originally taken from the template of the Cucumber project, then edited by hand. You can modify the template here.

@304NotModified 304NotModified changed the title Prefix generated Regex Prefix generated regexes with a caret (^) to ensure they are not interpreted as Cucumber expressions Jul 4, 2025
@304NotModified 304NotModified requested a review from clrudolphi July 7, 2025 19:12
@clrudolphi
Copy link
Contributor

I haven't reviewed the behavior of the skeleton provider in detail, but the test cases seem to indicate that it will generate regex expressions that use a match all template (such as (.*) ). Is the runtime Cucumber Expression parser/recognizer not smart enough to recognize that as a regex rather than a Cucumber expression?
IOW, if this the only expression type generated by the skeleton provider, how is the runtime mistakenly treating it as Cucumber expressions?
If there are other examples of mistaken parsing within the runtime:

  • a - shouldn't the tests for this feature demonstrate that those situations are ameliorated by the proposed fix?
  • b - could we instead make the runtime smarter so that it isn't confused by those situations?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants