Skip to content

binary-search: update to v1.3.0 #1620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exercises/binary-search/.meta/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.0
1.3.0
21 changes: 17 additions & 4 deletions exercises/binary-search/src/test/java/BinarySearchTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void findsAValueInAnArrayOfEvenLength() {

@Ignore("Remove to run test")
@Test
public void identifiesThatAValueIsNotIncludedInTheArray() {
public void identifiesThatAValueIsNotFoundInTheArray() {
List<Integer> sortedList = Collections.unmodifiableList(
Arrays.asList(1, 3, 4, 6, 8, 9, 11)
);
Expand All @@ -93,7 +93,7 @@ public void identifiesThatAValueIsNotIncludedInTheArray() {

@Ignore("Remove to run test")
@Test
public void aValueSmallerThanTheArraysSmallestValueIsNotIncluded() {
public void aValueSmallerThanTheArraysSmallestValueIsNotFound() {
List<Integer> sortedList = Collections.unmodifiableList(
Arrays.asList(1, 3, 4, 6, 8, 9, 11)
);
Expand All @@ -105,7 +105,7 @@ public void aValueSmallerThanTheArraysSmallestValueIsNotIncluded() {

@Ignore("Remove to run test")
@Test
public void aValueLargerThanTheArraysSmallestValueIsNotIncluded() {
public void aValueLargerThanTheArraysSmallestValueIsNotFound() {
List<Integer> sortedList = Collections.unmodifiableList(
Arrays.asList(1, 3, 4, 6, 8, 9, 11)
);
Expand All @@ -117,11 +117,24 @@ public void aValueLargerThanTheArraysSmallestValueIsNotIncluded() {

@Ignore("Remove to run test")
@Test
public void nothingIsIncludedInAnEmptyArray() {
public void nothingIsFoundInAnEmptyArray() {
List<Integer> emptyList = Collections.emptyList();

BinarySearch search = new BinarySearch(emptyList);

assertEquals(-1, search.indexOf(1));
}

@Ignore("Remove to run test")
@Test
public void nothingIsFoundWhenTheLeftAndRightBoundCross() {
List<Integer> sortedList = Collections.unmodifiableList(
Arrays.asList(1, 2)
);

BinarySearch search = new BinarySearch(sortedList);

assertEquals(-1, search.indexOf(0));
}

}