Skip to content

Commit

Permalink
Fix parsing of scenario_outline_with_value_with_trailing_backslash.fe…
Browse files Browse the repository at this point in the history
…ature
  • Loading branch information
everzet committed Oct 19, 2024
1 parent 76558c9 commit 5a0836d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Behat/Gherkin/Lexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ protected function scanTableRow()
$token = $this->takeToken('TableRow');
$line = mb_substr($line, 1, mb_strlen($line, 'utf8') - 2, 'utf8');
$columns = array_map(function ($column) {
return trim(str_replace('\\|', '|', $column));
return trim(str_replace(['\\|', '\\\\'], ['|', '\\'], $column));
}, preg_split('/(?<!\\\)\|/u', $line));
$token['columns'] = $columns;

Expand Down
4 changes: 2 additions & 2 deletions tests/Behat/Gherkin/Cucumber/CompatibilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ protected function setUp(): void
*/
public function testFeaturesParseTheSameAsCucumber(\SplFileInfo $file)
{

if (isset($this->notParsingCorrectly[$file->getFilename()])){
$this->markTestIncomplete($this->notParsingCorrectly[$file->getFilename()]);
}
Expand All @@ -86,7 +85,8 @@ public function testFeaturesParseTheSameAsCucumber(\SplFileInfo $file)

$this->assertEquals(
$this->normaliseFeature($expected),
$this->normaliseFeature($actual)
$this->normaliseFeature($actual),
file_get_contents($gherkinFile)
);
}

Expand Down

0 comments on commit 5a0836d

Please sign in to comment.