diff --git a/exercises/binary-search/.meta/version b/exercises/binary-search/.meta/version index 9084fa2f7..f0bb29e76 100644 --- a/exercises/binary-search/.meta/version +++ b/exercises/binary-search/.meta/version @@ -1 +1 @@ -1.1.0 +1.3.0 diff --git a/exercises/binary-search/src/test/java/BinarySearchTest.java b/exercises/binary-search/src/test/java/BinarySearchTest.java index 4f9149178..47b4acfa0 100644 --- a/exercises/binary-search/src/test/java/BinarySearchTest.java +++ b/exercises/binary-search/src/test/java/BinarySearchTest.java @@ -81,7 +81,7 @@ public void findsAValueInAnArrayOfEvenLength() { @Ignore("Remove to run test") @Test - public void identifiesThatAValueIsNotIncludedInTheArray() { + public void identifiesThatAValueIsNotFoundInTheArray() { List sortedList = Collections.unmodifiableList( Arrays.asList(1, 3, 4, 6, 8, 9, 11) ); @@ -93,7 +93,7 @@ public void identifiesThatAValueIsNotIncludedInTheArray() { @Ignore("Remove to run test") @Test - public void aValueSmallerThanTheArraysSmallestValueIsNotIncluded() { + public void aValueSmallerThanTheArraysSmallestValueIsNotFound() { List sortedList = Collections.unmodifiableList( Arrays.asList(1, 3, 4, 6, 8, 9, 11) ); @@ -105,7 +105,7 @@ public void aValueSmallerThanTheArraysSmallestValueIsNotIncluded() { @Ignore("Remove to run test") @Test - public void aValueLargerThanTheArraysSmallestValueIsNotIncluded() { + public void aValueLargerThanTheArraysSmallestValueIsNotFound() { List sortedList = Collections.unmodifiableList( Arrays.asList(1, 3, 4, 6, 8, 9, 11) ); @@ -117,11 +117,24 @@ public void aValueLargerThanTheArraysSmallestValueIsNotIncluded() { @Ignore("Remove to run test") @Test - public void nothingIsIncludedInAnEmptyArray() { + public void nothingIsFoundInAnEmptyArray() { List emptyList = Collections.emptyList(); BinarySearch search = new BinarySearch(emptyList); assertEquals(-1, search.indexOf(1)); } + + @Ignore("Remove to run test") + @Test + public void nothingIsFoundWhenTheLeftAndRightBoundCross() { + List sortedList = Collections.unmodifiableList( + Arrays.asList(1, 2) + ); + + BinarySearch search = new BinarySearch(sortedList); + + assertEquals(-1, search.indexOf(0)); + } + }