Skip to content

Commit

Permalink
Improve coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Jan 23, 2024
1 parent b7cc33b commit 20b2b4d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/test/java/edu/hm/hafner/util/LineRangeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,23 @@ void shouldFindLinesInsideAndOutsideOfLineRange() {
assertThat(lineRange.contains(1)).isTrue();
assertThat(lineRange.contains(2)).isTrue();
assertThat(lineRange.contains(3)).isFalse();
assertThat(lineRange).hasStart(1).hasEnd(2).hasLines(1, 2).hasToString("[1-2]");
assertThat(lineRange).hasStart(1).hasEnd(2)
.hasLines(1, 2).isNotSingleLine().hasToString("[1-2]");

var wrongOrder = new LineRange(2, 1);
assertThat(wrongOrder.contains(0)).isFalse();
assertThat(wrongOrder.contains(1)).isTrue();
assertThat(wrongOrder.contains(2)).isTrue();
assertThat(wrongOrder.contains(3)).isFalse();
assertThat(wrongOrder).hasStart(1).hasEnd(2).hasLines(1, 2).hasToString("[1-2]");
assertThat(wrongOrder).hasStart(1).hasEnd(2)
.hasLines(1, 2).isNotSingleLine().hasToString("[1-2]");

var point = new LineRange(2);
assertThat(point.contains(1)).isFalse();
assertThat(point.contains(2)).isTrue();
assertThat(point.contains(3)).isFalse();
assertThat(point).hasStart(2).hasEnd(2).hasLines(2).hasToString("[2-2]");
assertThat(point).hasStart(2).hasEnd(2)
.hasLines(2).isSingleLine().hasToString("[2-2]");
}

@Test
Expand Down

0 comments on commit 20b2b4d

Please sign in to comment.