Skip to content
Merged
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
1 change: 1 addition & 0 deletions doc/changes/changes_4.10.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Each release now includes an SPDX 3 SBOM for the product JAR and a SHA-256 check
## Bugfixes

* #582: Fixed the Markdown importer silently dropping all specification items after a fenced code block that directly follows a section title.
* #577: Fixed the Gherkin importer dropping a scenario when it directly follows another tagged scenario, with no boundary line between them.

## Documentation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ public void readLine(final int lineNumber, final String line)
}
if (this.importingScenario)
{
if (line.trim().startsWith("@"))
{
// A tag line is a Gherkin block boundary [dsn~gherkin.streaming-import~1] just as much as
// Scenario/Feature/Rule/Background/Examples are: it starts the metadata for the next
// scenario [dsn~gherkin.id-detection~1]. Without ending the current scenario here, this
// line would be swallowed as its description instead, and the next scenario would never
// get a pending id.
endScenario();
readMetadata(lineNumber, line);
return;
}
if (!line.trim().startsWith("#") && !line.trim().isEmpty())
{
this.listener.appendDescription(line + System.lineSeparator());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,31 @@ void testImportsScenariosWithDuplicateIds()
hasProperty("title", is("Second login"))));
}

// [utest->dsn~gherkin.streaming-import~1]
// [utest->dsn~gherkin.id-detection~1]
@Test
void testImportsConsecutiveTaggedScenariosWithoutAnInterveningBoundary()
{
final List<SpecificationItem> items = importText("""
@id:scn~first~1
# Needs: itest
Scenario: First scenario
Given a precondition

@id:scn~second~1
# Needs: itest
Scenario: Second scenario
Given another precondition
""");

assertAll(
() -> assertThat(items, contains(
hasProperty("id", hasToString("scn~first~1")),
hasProperty("id", hasToString("scn~second~1")))),
() -> assertThat(items.get(0).getDescription(), is("Given a precondition")),
() -> assertThat(items.get(1).getDescription(), is("Given another precondition")));
}

// [utest->dsn~gherkin.comment-coverage-tags~1]
@Test
void testImportsCommentCoverageTagsButIgnoresExecutableCoverageTags()
Expand Down
Loading