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 template regex in Scenario Outline expansion (#161) #163

Merged
merged 3 commits into from
Nov 16, 2021

Conversation

ilslv
Copy link
Member

@ilslv ilslv commented Nov 16, 2021

Resolves #161

Synopsis

See #161 for context.

Solution

Change TEMPLATE_REGEX from <(\S+)> to <([^>\s]+)>.

Checklist

  • Created PR:
    • In draft mode
    • Name contains Draft: prefix
    • Name contains issue reference
    • Has assignee
  • Documentation is updated (if required)
  • Tests are updated (if required)
  • Changes conform code style
  • CHANGELOG entry is added (if required)
  • FCM (final commit message) is posted
    • and approved
  • Review is completed and changes are approved
  • Before merge:
    • Milestone is set
    • PR's name and description are correct and up-to-date
    • Draft: prefix is removed
    • All temporary labels are removed

@ilslv ilslv added bug Something isn't working enhancement Improvement of existing features or bugfix labels Nov 16, 2021
@ilslv ilslv added this to the 0.11 milestone Nov 16, 2021
@ilslv ilslv self-assigned this Nov 16, 2021
@ilslv
Copy link
Member Author

ilslv commented Nov 16, 2021

FCM

Fix template regex in Scenario Outline expansion (#163, #161) 

@ilslv ilslv marked this pull request as ready for review November 16, 2021 12:20
@ilslv ilslv changed the title Draft: Fix template regex in Scenario Outline expansion (#161) Fix template regex in Scenario Outline expansion (#161) Nov 16, 2021
@ilslv ilslv requested a review from tyranron November 16, 2021 12:21
src/feature.rs Outdated
@@ -126,7 +126,7 @@ fn expand_scenario(
/// [`Examples`]: gherkin::Examples
#[allow(clippy::expect_used)]
static TEMPLATE_REGEX: Lazy<Regex> =
Lazy::new(|| Regex::new(r"<(\S+)>").expect("incorrect Regex"));
Lazy::new(|| Regex::new(r"<([^>]+)>").expect("incorrect Regex"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we allow [ \t\r\n\f] now, which doesn't seem to be good. I think [^>\s] is better here.

@tyranron tyranron removed the bug Something isn't working label Nov 16, 2021
@tyranron tyranron merged commit e8a51ad into main Nov 16, 2021
@tyranron tyranron deleted the 161-fix-template-regex branch November 16, 2021 13:56
remi-dupre added a commit to remi-dupre/mimirsbrunn that referenced this pull request Nov 18, 2021
There is an issue in cucumber with this kind of syntax which has not yet
been fixed in released package: cucumber-rs/cucumber#163
remi-dupre added a commit to Qwant/mimirsbrunn that referenced this pull request Sep 2, 2022
There is an issue in cucumber with this kind of syntax which has not yet
been fixed in released package: cucumber-rs/cucumber#163
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement of existing features or bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fail to parse feature when template are touching each other
2 participants