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

fix: condition to incorporate * in regEx to match step-syntax #51

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mohitpubnub
Copy link

The condition is making parser to ignore asterisk! And that leads parser to categorise line with * as text_line syntax and gives error:
Exception: Unknown runnable child given to Scenario 'TextLineRunnable'

fix: condition to incorporate `*` in regEx to match step-syntax
@jonsamwell
Copy link
Owner

@mohitpubnub thank you for the PR. Could you clarify what this is fixing by giving an example. Please also add a test for this

…en/when/then/and.

add: asterisk in DialectMock to recognise it in test.
@mohitpubnub
Copy link
Author

@jonsamwell gherkin syntax supports asterisk in feature file (Gherkin Reference)
While parsing feature file, Parser was ignoring * due to condition(mentioned in earlier comment)
Have added test for this and updated dialect mock. For readability, added * wherever it's applicable. Per gherkin language standards.

@jonsamwell
Copy link
Owner

@mohitpubnub many thanks for this and your explanation. It is a great change, thanks for providing the PR.

As this could have quite sweeping changes could you add the referenced features (See below) as a couple of tests to this full syntax parsing suite (https://github.com/jonsamwell/dart_gherkin/blob/master/test/gherkin/parser_test.dart#L17).

Scenario: All done
  Given I am out shopping
  And I have eggs
  And I have milk
  And I have butter
  When I check my list
  Then I don't need anything
Could be expressed as:

Scenario: All done
  Given I am out shopping
  * I have eggs
  * I have milk
  * I have butter
  When I check my list
  Then I don't need anything

Sorry for being pedantic here I just don't want this change to have unexpected consequences.

@mohitpubnub
Copy link
Author

mohitpubnub commented Sep 28, 2021

@jonsamwell Now parser recognises line starting with asterisks at

'''
*
abc
'''
And the following universe:
'''
*
'''
. as step syntax. Which is not expected in multiline description.

I'm not sure, Is this correct scenario for multiline description or need to change test suite content? any thought?

@mohitpubnub
Copy link
Author

I'm not sure, Is this correct behaviour for multiline description or need to change test suite content? any thought?

Also because, cucumber-js is not able to parse feature file that has text enclosed with ''' ''' between step clauses.

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