Skip to content

Commit 39b0f05

Browse files
author
dupirefr
committed
[BAEL-3348] Added test to prove algorithm behaviour on array suggested in article comment
1 parent d6e6999 commit 39b0f05

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/smallestinteger/SmallestMissingPositiveIntegerUnitTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,13 @@ void givenArrayWithoutMissingInteger_whenSearchInUnsortedArrayBooleanArray_thenA
8585

8686
assertThat(result).isEqualTo(input.length);
8787
}
88+
89+
@Test
90+
void givenArrayFromArticleComment_whenSearchInUnsortedArrayBooleanArray_thenZero() {
91+
int[] input = new int[] {11, 13, 14, 15};
92+
93+
int result = SmallestMissingPositiveInteger.searchInUnsortedArrayBooleanArray(input);
94+
95+
assertThat(result).isEqualTo(0);
96+
}
8897
}

0 commit comments

Comments
 (0)