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

Datatable malformed without compilation error #298

Open
deblockt opened this issue Sep 27, 2024 · 1 comment
Open

Datatable malformed without compilation error #298

deblockt opened this issue Sep 27, 2024 · 1 comment
Labels
πŸ› bug Defect / Bug

Comments

@deblockt
Copy link

πŸ‘“ What did you see?

    When step
      | version | contract id                          
      | 1       | 73566f56-05b1-4ef2-92bc-636f55f2789c

This step can be compiled by cucumber, but the column contract id is not send to the java implemenation.

βœ… What did you expect to see?

Two expected behaviors can be expected:

  • have a compilation error
  • send contract id to the java implementation

πŸ“¦ Which tool/library version are you using?

cucumber-java 7.15.0
java 21

πŸ”¬ How could we reproduce it?

No response

πŸ“š Any additional context?

No response

@mpkorstanje mpkorstanje transferred this issue from cucumber/cucumber-jvm Oct 10, 2024
@mpkorstanje
Copy link
Contributor

Some context if anyone wants to look into this:

This behavior is obviously broken but it snuck into almost every implementation unnoticed. I added a test case to confirm this is the current behavior. This was intended to ensure all parsers were at least consistently wrong. Feel free to change this testcase to a failing one. As long as all parsers complain consistently it should be fine.

One problem though is that Gherkin is now 11 years old.

This means that someone out there will be using this as a feature to add comments at the back of their tables. So it would be sensible to add support for comments after a table.

Parse error:

Feature: Extra table content
  Scenario: We're a bit extra
    Given a pirate crew
      | Luffy | Zorro | Doflamingo
      | Nami  | Brook | BlackBeard

No parse error:

Feature: Extra table content
  Scenario: We're a bit extra
    Given a pirate crew
      | Luffy | Zorro |  # Doflamingo
      | Nami  | Brook | # BlackBeard

Any comment markers before the last pipe would have to be treated as regular text:

Feature: Extra table content
  Scenario: We're a bit extra
    Given a pirate crew
      | Luffy | Zorro |  # Doflamingo
      | Nami  |# Brook | # BlackBeard

@mpkorstanje mpkorstanje added the πŸ› bug Defect / Bug label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
πŸ› bug Defect / Bug
Projects
None yet
Development

No branches or pull requests

2 participants