ttutisani / Xunit.Gherkin.Quick

BDD in .NET Core - using Xunit and Gherkin (compatible with both .NET Core and .NET)
MIT License
205 stars 29 forks source link

Fix regex for Examples for Scenario Outlines to match only correct tags. #150

Closed farost closed 8 months ago

farost commented 8 months ago

This PR fixes the issue with incorrect examples placeholders parsing, which does not, for example, let us using it in combination with some of the comparison operators (<, <=).

We change the matching pattern for these placeholders. Now it's the following:

  1. First char should be alphanumeric: [A-Z | a-z | 0-9] (empty names are not supported)
  2. Anything between the first and the last chars (if applicable) can be anything except of '<' and '>' so the placeholders are not confusing for both the users and the matcher. We don't provide escaping for such symbols, expecting that there should not be a need to use such symbols as part of a placeholder's name.
  3. Last char should be alphanumeric: [A-Z | a-z | 0-9] (last char == first char for single-char namesj
farost commented 8 months ago

Some of the comments are taken into account and used in action. Some of the comments have just been replied to.