@@ -10,7 +10,7 @@ fn test_clone_eq() {
10
10
m. insert ( 1 ) ;
11
11
m. insert ( 2 ) ;
12
12
13
- assert ! ( m. clone( ) == m) ;
13
+ assert_eq ! ( m. clone( ) , m) ;
14
14
}
15
15
16
16
#[ test]
@@ -28,7 +28,7 @@ fn test_hash() {
28
28
y. insert ( 2 ) ;
29
29
y. insert ( 1 ) ;
30
30
31
- assert ! ( hash( & x) == hash( & y) ) ;
31
+ assert_eq ! ( hash( & x) , hash( & y) ) ;
32
32
}
33
33
34
34
fn check < F > ( a : & [ i32 ] , b : & [ i32 ] , expected : & [ i32 ] , f : F )
@@ -69,6 +69,11 @@ fn test_intersection() {
69
69
check_intersection ( & [ 11 , 1 , 3 , 77 , 103 , 5 , -5 ] ,
70
70
& [ 2 , 11 , 77 , -9 , -42 , 5 , 3 ] ,
71
71
& [ 3 , 5 , 11 , 77 ] ) ;
72
+
73
+ if cfg ! ( miri) { // Miri is too slow
74
+ return ;
75
+ }
76
+
72
77
let large = ( 0 ..1000 ) . collect :: < Vec < _ > > ( ) ;
73
78
check_intersection ( & [ ] , & large, & [ ] ) ;
74
79
check_intersection ( & large, & [ ] , & [ ] ) ;
@@ -98,6 +103,11 @@ fn test_difference() {
98
103
check_difference ( & [ -5 , 11 , 22 , 33 , 40 , 42 ] ,
99
104
& [ -12 , -5 , 14 , 23 , 34 , 38 , 39 , 50 ] ,
100
105
& [ 11 , 22 , 33 , 40 , 42 ] ) ;
106
+
107
+ if cfg ! ( miri) { // Miri is too slow
108
+ return ;
109
+ }
110
+
101
111
let large = ( 0 ..1000 ) . collect :: < Vec < _ > > ( ) ;
102
112
check_difference ( & [ ] , & large, & [ ] ) ;
103
113
check_difference ( & [ -1 ] , & large, & [ -1 ] ) ;
@@ -166,6 +176,17 @@ fn test_is_subset() {
166
176
assert_eq ! ( is_subset( & [ 1 , 2 ] , & [ 1 ] ) , false ) ;
167
177
assert_eq ! ( is_subset( & [ 1 , 2 ] , & [ 1 , 2 ] ) , true ) ;
168
178
assert_eq ! ( is_subset( & [ 1 , 2 ] , & [ 2 , 3 ] ) , false ) ;
179
+ assert_eq ! ( is_subset( & [ -5 , 11 , 22 , 33 , 40 , 42 ] ,
180
+ & [ -12 , -5 , 14 , 23 , 11 , 34 , 22 , 38 , 33 , 42 , 39 , 40 ] ) ,
181
+ true ) ;
182
+ assert_eq ! ( is_subset( & [ -5 , 11 , 22 , 33 , 40 , 42 ] ,
183
+ & [ -12 , -5 , 14 , 23 , 34 , 38 , 22 , 11 ] ) ,
184
+ false ) ;
185
+
186
+ if cfg ! ( miri) { // Miri is too slow
187
+ return ;
188
+ }
189
+
169
190
let large = ( 0 ..1000 ) . collect :: < Vec < _ > > ( ) ;
170
191
assert_eq ! ( is_subset( & [ ] , & large) , true ) ;
171
192
assert_eq ! ( is_subset( & large, & [ ] ) , false ) ;
@@ -371,7 +392,10 @@ fn test_split_off_empty_left() {
371
392
372
393
#[ test]
373
394
fn test_split_off_large_random_sorted ( ) {
395
+ #[ cfg( not( miri) ) ] // Miri is too slow
374
396
let mut data = rand_data ( 1529 ) ;
397
+ #[ cfg( miri) ]
398
+ let mut data = rand_data ( 529 ) ;
375
399
// special case with maximum height.
376
400
data. sort ( ) ;
377
401
0 commit comments