Skip to content

Commit

Permalink
[Gherkin / Java] Add test to ensure #290 is not present (and will not…
Browse files Browse the repository at this point in the history
… be)
  • Loading branch information
vincent-psarga committed Oct 23, 2019
1 parent 4a7fa26 commit f2a174f
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,32 @@ public void throws_on_illegal_escapes_backslash() {
List<String> texts = gherkinLine.getTableCells().stream().map(span -> span.text).collect(Collectors.toList());
assertEquals(asList("\\o\no|"), texts);
}

@Test
public void correctly_trims_white_spaces_before_cell_content() {
GherkinLine gherkinLine = new GherkinLine("| \t spaces before|");
List<String> texts = gherkinLine.getTableCells().stream().map(span -> span.text).collect(Collectors.toList());
assertEquals(asList("spaces before"), texts);
}

@Test
public void correctly_trims_white_spaces_after_cell_content() {
GherkinLine gherkinLine = new GherkinLine("|spaces after |");
List<String> texts = gherkinLine.getTableCells().stream().map(span -> span.text).collect(Collectors.toList());
assertEquals(asList("spaces after"), texts);
}

@Test
public void correctly_trims_white_spaces_around_cell_content() {
GherkinLine gherkinLine = new GherkinLine("| \t spaces everywhere \t|");
List<String> texts = gherkinLine.getTableCells().stream().map(span -> span.text).collect(Collectors.toList());
assertEquals(asList("spaces everywhere"), texts);
}

@Test
public void does_not_drop_white_spaces_inside_a_cell() {
GherkinLine gherkinLine = new GherkinLine("| foo()\n bar\nbaz |");
List<String> texts = gherkinLine.getTableCells().stream().map(span -> span.text).collect(Collectors.toList());
assertEquals(asList("foo()\n bar\nbaz"), texts);
}
}

0 comments on commit f2a174f

Please sign in to comment.