You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature: EscapingScenario Outline:
* '<a>' should equal '|'* '<b>' should equal '\\\+'* '<c>' should equal '\\\\\\'Examples:
| a | b | c | | \| | \\\\\\+ | \\\\\\\\\\\\ |
If run with this step definition:
Given(/^'([^']*)' should equal '([^']*)'$/)do |x,y|
x.should == yend
The same feature passes if run with Cucumber-JVM and this step definition:
@Given("^'([^']*)' should equal '([^']*)'$")
publicvoidcheckEquality(Stringx, Stringy) {
assertEquals(y, x);
}
Current Behavior
It fails on the second step with:
expected: "\\\\\\+"
got: "\\" (using ==) (RSpec::Expectations::ExpectationNotMetError)
./features/step_definitions/escaping.rb:6:in `/^'([^']*)' should equal '([^']*)'$/'
features/escaping.feature:10:in `* '\' should equal '\\\+''
features/escaping.feature:5:in `* '<b>' should equal '\\\+''
By printing the step name in an AfterStep hook, the above Scenario Outline gets expanded to:
Feature: EscapingScenario Outline:
* '|' should equal '|'* '\' should equal '\\\+' * '\\\' should equal '\\\\\\'
Possible Solution
Escaping seems to be correct in the Gherkin parser (at least 4.0.0). The same issue is present at least from version 1.3.20 to the latest 2.4.0, so it's probably not a parser problem. No idea where to look in Cucumber-Ruby.
Steps to Reproduce (for bugs)
Create a feature file and a step definition file as described in the "Expected Behavior" section
Run Cucumber-Ruby
Context & Motivation
Was writing scenarios to test regex escaping in the snippets generation of Cucumber-CPP, that still uses Cucumber-Ruby and Aruba for E2E testing.
Summary
Step name is incorrect when multiple backslashes are present in the Examples block.
Expected Behavior
The step name should be obtained by just filling the placeholders with the values in the Examples block
The only escaping should be that defined by the Gherkin grammar:
The \-character will be considered as an escape in table cell iff it is followed by a |-character, a \-character or an n.
I would expect this feature to pass:
If run with this step definition:
The same feature passes if run with Cucumber-JVM and this step definition:
Current Behavior
It fails on the second step with:
By printing the step name in an AfterStep hook, the above Scenario Outline gets expanded to:
Possible Solution
Escaping seems to be correct in the Gherkin parser (at least 4.0.0). The same issue is present at least from version 1.3.20 to the latest 2.4.0, so it's probably not a parser problem. No idea where to look in Cucumber-Ruby.
Steps to Reproduce (for bugs)
Context & Motivation
Was writing scenarios to test regex escaping in the snippets generation of Cucumber-CPP, that still uses Cucumber-Ruby and Aruba for E2E testing.
Your Environment
The text was updated successfully, but these errors were encountered: