Skip to content

java: Prefer the longest step keyword#401

Merged
mpkorstanje merged 1 commit intomainfrom
fix/java-prefer-longest-step-keyword
May 23, 2025
Merged

java: Prefer the longest step keyword#401
mpkorstanje merged 1 commit intomainfrom
fix/java-prefer-longest-step-keyword

Conversation

@mpkorstanje
Copy link
Copy Markdown
Contributor

@mpkorstanje mpkorstanje commented May 23, 2025

⚡️ What's your motivation?

Step keywords may be prefixes of each other. For example in French several variations of given start with Etant donné. When this is the case Gherkin should prefer the longest possible keyword.

This is currently only implicitly enforced by manually ordering the keywords.

However, for Creole language the prefixes are spread between then and when so manually sorting them is no longer possible.

Partially resolves: #400

🏷️ What kind of change is this?

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

♻️ Anything particular you want feedback on?

📋 Checklist:

@mpkorstanje mpkorstanje force-pushed the fix/java-prefer-longest-step-keyword branch from ebdf47a to 074c4e2 Compare May 23, 2025 11:48
@mpkorstanje mpkorstanje changed the title Prefer the longest step keyword [Java] Prefer the longest step keyword May 23, 2025
@mpkorstanje mpkorstanje changed the title [Java] Prefer the longest step keyword java: Prefer the longest step keyword May 23, 2025
@mpkorstanje mpkorstanje force-pushed the fix/java-prefer-longest-step-keyword branch from 074c4e2 to f959571 Compare May 23, 2025 11:54
Step keywords may be prefixes of each other. For example in French
several variations of given start with `Etant donné`. When this is the
case Gherkin should prefer the longest possible keyword.

This is currently only implicitly enforced by manually ordering the
keywords.

However, for Creole language the prefixes are spread between then and
when so manually sorting them is no longer possible.

Partially resolves: #400
@mpkorstanje mpkorstanje force-pushed the fix/java-prefer-longest-step-keyword branch from f959571 to 9b00239 Compare May 23, 2025 11:59
@mpkorstanje mpkorstanje marked this pull request as ready for review May 23, 2025 11:59
@mpkorstanje mpkorstanje merged commit a9b8928 into main May 23, 2025
4 checks passed
@mpkorstanje mpkorstanje deleted the fix/java-prefer-longest-step-keyword branch May 23, 2025 12:40
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

1 participant