Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

## Improvements:

* Generated regexes are prefixed with a caret (`^`) to ensure they are not interpreted as Cucumber expressions. (#98)

## Bug fixes:

* Fix: Ambiguous steps reported wehn definition matches via more than one tag (#95)
*Contributors of this release (in alphabetical order):* @clrudolphi

*Contributors of this release (in alphabetical order):* @304NotModified, @clrudolphi

# v2025.1.256 - 2025-03-07

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public RegexStepDefinitionSkeletonProvider(ReqnrollProjectTraits projectTraits)

protected override string GetExpression(AnalyzedStepText stepText)
{
StringBuilder result = new StringBuilder();
// Prefix regex with ^ to ensure that it's detected as regex instead of a cucumber expression.
StringBuilder result = new StringBuilder("^");

result.Append(EscapeRegex(stepText.TextParts[0]));
for (int i = 1; i < stepText.TextParts.Count; i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Scenario: DefineSteps command abides by reqnroll.json configuration for regex sk
When I invoke the "Define Steps" command
Then the define steps dialog should be opened with the following step definition skeletons
| type | expression |
| Given | the client added (.*) pcs to the basket |
| Given | ^the client added (.*) pcs to the basket |

Scenario: DefineSteps command properly escapes empty brackets when using Cucumber expressions
Given there is a Reqnroll project scope
Expand Down Expand Up @@ -161,5 +161,5 @@ Scenario: DefineSteps command properly escapes empty brackets when using Regex e
When I invoke the "Define Steps" command
Then the define steps dialog should be opened with the following step definition skeletons
| type | expression |
| When | I use \\(parenthesis\), \\{curly braces}, \\\ backslash, and/or \\. period |
| When | ^I use \\(parenthesis\), \\{curly braces}, \\\ backslash, and/or \\. period |

Loading