From 20b2b4df1f0b9de26c450bfaeef4e9875dead11a Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Tue, 23 Jan 2024 16:23:09 +0100 Subject: [PATCH] Improve coverage. --- src/test/java/edu/hm/hafner/util/LineRangeTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/test/java/edu/hm/hafner/util/LineRangeTest.java b/src/test/java/edu/hm/hafner/util/LineRangeTest.java index f2b79185..c81d3074 100644 --- a/src/test/java/edu/hm/hafner/util/LineRangeTest.java +++ b/src/test/java/edu/hm/hafner/util/LineRangeTest.java @@ -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