File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ impl BigBitv {
156
156
fn each_storage ( op : fn ( v : & mut uint ) -> bool ) {
157
157
for uint:: range( 0 , self . storage. len( ) ) |i| {
158
158
let mut w = self . storage [ i] ;
159
- let b = ! op ( & mut w) ;
159
+ let b = op ( & mut w) ;
160
160
self . storage [ i] = w;
161
161
if !b { break ; }
162
162
}
@@ -981,6 +981,24 @@ mod tests {
981
981
assert !b1[40];
982
982
assert !b1[80];
983
983
}
984
+
985
+ #[test]
986
+ pub fn test_small_clear() {
987
+ let b = Bitv(14, true);
988
+ b.clear();
989
+ for b.ones |i| {
990
+ die!(fmt!(" found 1 at %?", i));
991
+ }
992
+ }
993
+
994
+ #[test]
995
+ pub fn test_big_clear() {
996
+ let b = Bitv(140, true);
997
+ b.clear();
998
+ for b.ones |i| {
999
+ die!(fmt!(" found 1 at %?" , i) ) ;
1000
+ }
1001
+ }
984
1002
}
985
1003
986
1004
//
You can’t perform that action at this time.
0 commit comments