Skip to content

Unable to match pattern with line continuation and no further characters on second line #319

@kieran-ryan

Description

@kieran-ryan

What did you observe?

Integrating support for line continuations in step definition patterns into the official cucumber VSCode extension (cucumber/vscode#179). Was unsure how to handle a line continuation no further characters on the following line. No error thrown, and was unable to find a matching gherkin step.

With the below example, I would have assumed the gherkin text (which includes a trailing space) would have matched the pattern.

#[given("a line continuation \
")]
fn hungry_cat(world: &mut AnimalWorld) {
    world.cat.hungry = true;
}
Given a line continuation 

For a working example, having a character on the second line would match as follows:

#[given("a line continuation \
!")]
fn hungry_cat(world: &mut AnimalWorld) {
    world.cat.hungry = true;
}
Given a line continuation !

Where are you looking for help?

Is there a gherkin step text example that matches the above pattern?

Version information

  • rustc 1.75.0
  • cucumber 0.20.2

Metadata

Metadata

Assignees

Labels

enhancementImprovement of existing features or bugfixhelp wantedExtra attention is neededk::UI/UXUI (user interface) and UX (user experience) changes

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions