@@ -10,7 +10,7 @@ fn test_clone_eq() {
1010 m. insert ( 1 ) ;
1111 m. insert ( 2 ) ;
1212
13- assert ! ( m. clone( ) == m) ;
13+ assert_eq ! ( m. clone( ) , m) ;
1414}
1515
1616#[ test]
@@ -28,7 +28,7 @@ fn test_hash() {
2828 y. insert ( 2 ) ;
2929 y. insert ( 1 ) ;
3030
31- assert ! ( hash( & x) == hash( & y) ) ;
31+ assert_eq ! ( hash( & x) , hash( & y) ) ;
3232}
3333
3434fn check < F > ( a : & [ i32 ] , b : & [ i32 ] , expected : & [ i32 ] , f : F )
@@ -69,6 +69,11 @@ fn test_intersection() {
6969 check_intersection ( & [ 11 , 1 , 3 , 77 , 103 , 5 , -5 ] ,
7070 & [ 2 , 11 , 77 , -9 , -42 , 5 , 3 ] ,
7171 & [ 3 , 5 , 11 , 77 ] ) ;
72+
73+ if cfg ! ( miri) { // Miri is too slow
74+ return ;
75+ }
76+
7277 let large = ( 0 ..1000 ) . collect :: < Vec < _ > > ( ) ;
7378 check_intersection ( & [ ] , & large, & [ ] ) ;
7479 check_intersection ( & large, & [ ] , & [ ] ) ;
@@ -98,6 +103,11 @@ fn test_difference() {
98103 check_difference ( & [ -5 , 11 , 22 , 33 , 40 , 42 ] ,
99104 & [ -12 , -5 , 14 , 23 , 34 , 38 , 39 , 50 ] ,
100105 & [ 11 , 22 , 33 , 40 , 42 ] ) ;
106+
107+ if cfg ! ( miri) { // Miri is too slow
108+ return ;
109+ }
110+
101111 let large = ( 0 ..1000 ) . collect :: < Vec < _ > > ( ) ;
102112 check_difference ( & [ ] , & large, & [ ] ) ;
103113 check_difference ( & [ -1 ] , & large, & [ -1 ] ) ;
@@ -166,6 +176,17 @@ fn test_is_subset() {
166176 assert_eq ! ( is_subset( & [ 1 , 2 ] , & [ 1 ] ) , false ) ;
167177 assert_eq ! ( is_subset( & [ 1 , 2 ] , & [ 1 , 2 ] ) , true ) ;
168178 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+
169190 let large = ( 0 ..1000 ) . collect :: < Vec < _ > > ( ) ;
170191 assert_eq ! ( is_subset( & [ ] , & large) , true ) ;
171192 assert_eq ! ( is_subset( & large, & [ ] ) , false ) ;
@@ -371,7 +392,10 @@ fn test_split_off_empty_left() {
371392
372393#[ test]
373394fn test_split_off_large_random_sorted ( ) {
395+ #[ cfg( not( miri) ) ] // Miri is too slow
374396 let mut data = rand_data ( 1529 ) ;
397+ #[ cfg( miri) ]
398+ let mut data = rand_data ( 529 ) ;
375399 // special case with maximum height.
376400 data. sort ( ) ;
377401
0 commit comments