Skip to content

Commit dd327fc

Browse files
authored
Merge pull request #1620 from lemoncurry/binary-search-updatetest
binary-search: update to v1.3.0
2 parents 42c46fd + 43f30ae commit dd327fc

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

exercises/binary-search/.meta/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.0
1+
1.3.0

exercises/binary-search/src/test/java/BinarySearchTest.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public void findsAValueInAnArrayOfEvenLength() {
8181

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

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

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

118118
@Ignore("Remove to run test")
119119
@Test
120-
public void nothingIsIncludedInAnEmptyArray() {
120+
public void nothingIsFoundInAnEmptyArray() {
121121
List<Integer> emptyList = Collections.emptyList();
122122

123123
BinarySearch search = new BinarySearch(emptyList);
124124

125125
assertEquals(-1, search.indexOf(1));
126126
}
127+
128+
@Ignore("Remove to run test")
129+
@Test
130+
public void nothingIsFoundWhenTheLeftAndRightBoundCross() {
131+
List<Integer> sortedList = Collections.unmodifiableList(
132+
Arrays.asList(1, 2)
133+
);
134+
135+
BinarySearch search = new BinarySearch(sortedList);
136+
137+
assertEquals(-1, search.indexOf(0));
138+
}
139+
127140
}

0 commit comments

Comments
 (0)