Skip to content

[cpp] Prefer the longest step keyword #416

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

Merged
merged 2 commits into from
Jun 18, 2025

Conversation

musicinmybrain
Copy link
Contributor

@musicinmybrain musicinmybrain commented Jun 17, 2025

🤔 What's changed?

In C++, prefer the longest step keyword by sorting in descending order by length in bytes before matching.

⚡️ What's your motivation?

Fixes #400 for C++.

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

♻️ Anything particular you want feedback on?

When combined with #414, I find that this fixes the C++ acceptance tests, which makes it a partial fix for #412.

Ideally, though, someone familiar with the gherkin language and the other implementations would also confirm that this fix looks right.

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes. N/A, fixes existing tests
  • 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 "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

@musicinmybrain musicinmybrain mentioned this pull request Jun 17, 2025
1 task
@mpkorstanje mpkorstanje merged commit 5950066 into cucumber:main Jun 18, 2025
5 checks passed
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.

Step keywords are not matched properly when some keywords are prefixes of each other
2 participants