@@ -16,23 +16,13 @@ where
16
16
let mut cache = BTreeMap :: new ( ) ;
17
17
let mut predicate = |idx : usize | * cache. entry ( idx) . or_insert_with ( || predicate ( & slice[ idx] ) ) ;
18
18
let mut unknown_ranges: Vec < ( usize , usize ) > = Vec :: new ( ) ;
19
- let mut rm_no = 0 ; // presume that the slice starts with a no
19
+ // presume that the slice starts with a no
20
+ // this should be tested before call
21
+ let mut rm_no = 0 ;
20
22
21
- eprintln ! ( "verifying the start of the range does not reproduce the regression" ) ;
22
- match predicate ( rm_no) {
23
- Satisfies :: No => {
24
- eprintln ! ( "confirmed the start of the range does not reproduce the regression" )
25
- }
26
- _ => panic ! ( "the start of the range to test must not reproduce the regression" ) ,
27
- }
28
-
29
- let mut lm_yes = slice. len ( ) - 1 ; // presume that the slice ends with a yes
30
-
31
- eprintln ! ( "verifying the end of the range reproduces the regression" ) ;
32
- match predicate ( lm_yes) {
33
- Satisfies :: Yes => eprintln ! ( "confirmed the end of the range reproduces the regression" ) ,
34
- _ => panic ! ( "the end of the range to test must reproduce the regression" ) ,
35
- }
23
+ // presume that the slice ends with a yes
24
+ // this should be tested before the call
25
+ let mut lm_yes = slice. len ( ) - 1 ;
36
26
37
27
let mut next = ( rm_no + lm_yes) / 2 ;
38
28
@@ -111,7 +101,7 @@ mod tests {
111
101
#[ test]
112
102
fn least_satisfying_1 ( ) {
113
103
assert_eq ! (
114
- least_satisfying( & [ No , Unknown , Unknown , No , Yes ] , |i| * i) ,
104
+ least_satisfying( & [ No , Unknown , Unknown , No , Yes ] , |i| * i) ,
115
105
4
116
106
) ;
117
107
}
@@ -155,7 +145,7 @@ mod tests {
155
145
#[ test]
156
146
fn least_satisfying_8 ( ) {
157
147
assert_eq ! (
158
- least_satisfying( & [ No , Unknown , No , No , Unknown , Yes , Yes ] , |i| * i) ,
148
+ least_satisfying( & [ No , Unknown , No , No , Unknown , Yes , Yes ] , |i| * i) ,
159
149
5
160
150
) ;
161
151
}
0 commit comments