2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,14 @@ export function testSearchAlgorithm(
33
33
expect ( searchAlgorithm ( array , SIZE ) ) . to . equal ( SIZE - 1 ) ;
34
34
} ) ;
35
35
36
+ it ( 'finds value at different positions' , ( ) => {
37
+ const array = createSortedArray ( ) ;
38
+
39
+ for ( let value = 1 ; value <= SIZE ; value ++ ) {
40
+ expect ( searchAlgorithm ( array , value ) ) . to . equal ( value - 1 ) ;
41
+ }
42
+ } ) ;
43
+
36
44
if ( config . customEquals ) {
37
45
it ( 'finds value with custom equals function' , ( ) => {
38
46
const array = [ { key : 1 } , { key : 2 } , { key : 3 } ] ;
Original file line number Diff line number Diff line change @@ -39,6 +39,14 @@ export function testSearchAlgorithm(
39
39
expect ( searchAlgorithm ( array , SIZE ) ) . to . equal ( SIZE - 1 ) ;
40
40
} ) ;
41
41
42
+ it ( 'finds value at different positions' , ( ) => {
43
+ const array = createSortedArray ( ) ;
44
+
45
+ for ( let value = 1 ; value <= SIZE ; value ++ ) {
46
+ expect ( searchAlgorithm ( array , value ) ) . to . equal ( value - 1 ) ;
47
+ }
48
+ } ) ;
49
+
42
50
if ( config . customEquals ) {
43
51
it ( 'finds value with custom equals function' , ( ) => {
44
52
const array = [ { key : 1 } , { key : 2 } , { key : 3 } ] ;
0 commit comments