@@ -31,6 +31,7 @@ fn test_rfind() {
3131}
3232
3333#[ test]
34+ #[ cfg( not( miri) ) ]
3435fn test_collect ( ) {
3536 let empty = "" ;
3637 let s: String = empty. chars ( ) . collect ( ) ;
@@ -118,6 +119,7 @@ fn test_concat_for_different_types() {
118119#[ test]
119120fn test_concat_for_different_lengths ( ) {
120121 let empty: & [ & str ] = & [ ] ;
122+ #[ cfg( not( miri) ) ]
121123 test_concat ! ( "" , empty) ;
122124 test_concat ! ( "a" , [ "a" ] ) ;
123125 test_concat ! ( "ab" , [ "a" , "b" ] ) ;
@@ -146,6 +148,7 @@ fn test_join_for_different_types() {
146148#[ test]
147149fn test_join_for_different_lengths ( ) {
148150 let empty: & [ & str ] = & [ ] ;
151+ #[ cfg( not( miri) ) ]
149152 test_join ! ( "" , empty, "-" ) ;
150153 test_join ! ( "a" , [ "a" ] , "-" ) ;
151154 test_join ! ( "a-b" , [ "a" , "b" ] , "-" ) ;
@@ -159,13 +162,15 @@ fn test_join_for_different_lengths_with_long_separator() {
159162 assert_eq ! ( "~~~~~" . len( ) , 15 ) ;
160163
161164 let empty: & [ & str ] = & [ ] ;
165+ #[ cfg( not( miri) ) ]
162166 test_join ! ( "" , empty, "~~~~~" ) ;
163167 test_join ! ( "a" , [ "a" ] , "~~~~~" ) ;
164168 test_join ! ( "a~~~~~b" , [ "a" , "b" ] , "~~~~~" ) ;
165169 test_join ! ( "~~~~~a~~~~~bc" , [ "" , "a" , "bc" ] , "~~~~~" ) ;
166170}
167171
168172#[ test]
173+ #[ cfg( not( miri) ) ]
169174fn test_unsafe_slice ( ) {
170175 assert_eq ! ( "ab" , unsafe { "abc" . get_unchecked( 0 ..2 ) } ) ;
171176 assert_eq ! ( "bc" , unsafe { "abc" . get_unchecked( 1 ..3 ) } ) ;
@@ -238,6 +243,7 @@ fn test_replacen() {
238243#[ test]
239244fn test_replace ( ) {
240245 let a = "a" ;
246+ #[ cfg( not( miri) ) ]
241247 assert_eq ! ( "" . replace( a, "b" ) , "" ) ;
242248 assert_eq ! ( "a" . replace( a, "b" ) , "b" ) ;
243249 assert_eq ! ( "ab" . replace( a, "b" ) , "bb" ) ;
@@ -297,6 +303,7 @@ fn test_replace_pattern() {
297303// The current implementation of SliceIndex fails to handle methods
298304// orthogonally from range types; therefore, it is worth testing
299305// all of the indexing operations on each input.
306+ #[ cfg( not( miri) ) ]
300307mod slice_index {
301308 // Test a slicing operation **that should succeed,**
302309 // testing it on all of the indexing methods.
@@ -679,6 +686,7 @@ fn test_str_slice_rangetoinclusive_ok() {
679686
680687#[ test]
681688#[ should_panic]
689+ #[ cfg( not( miri) ) ]
682690fn test_str_slice_rangetoinclusive_notok ( ) {
683691 let s = "abcαβγ" ;
684692 & s[ ..=3 ] ;
@@ -694,6 +702,7 @@ fn test_str_slicemut_rangetoinclusive_ok() {
694702
695703#[ test]
696704#[ should_panic]
705+ #[ cfg( not( miri) ) ]
697706fn test_str_slicemut_rangetoinclusive_notok ( ) {
698707 let mut s = "abcαβγ" . to_owned ( ) ;
699708 let s: & mut str = & mut s;
@@ -883,6 +892,7 @@ fn test_as_bytes() {
883892
884893#[ test]
885894#[ should_panic]
895+ #[ cfg( not( miri) ) ]
886896fn test_as_bytes_fail ( ) {
887897 // Don't double free. (I'm not sure if this exercises the
888898 // original problem code path anymore.)
@@ -972,6 +982,7 @@ fn test_split_at_mut() {
972982
973983#[ test]
974984#[ should_panic]
985+ #[ cfg( not( miri) ) ]
975986fn test_split_at_boundscheck ( ) {
976987 let s = "ศไทย中华Việt Nam" ;
977988 s. split_at ( 1 ) ;
@@ -1066,6 +1077,7 @@ fn test_rev_iterator() {
10661077}
10671078
10681079#[ test]
1080+ #[ cfg( not( miri) ) ]
10691081fn test_chars_decoding ( ) {
10701082 let mut bytes = [ 0 ; 4 ] ;
10711083 for c in ( 0 ..0x110000 ) . filter_map ( std:: char:: from_u32) {
@@ -1077,6 +1089,7 @@ fn test_chars_decoding() {
10771089}
10781090
10791091#[ test]
1092+ #[ cfg( not( miri) ) ]
10801093fn test_chars_rev_decoding ( ) {
10811094 let mut bytes = [ 0 ; 4 ] ;
10821095 for c in ( 0 ..0x110000 ) . filter_map ( std:: char:: from_u32) {
@@ -1306,6 +1319,7 @@ fn test_splitator() {
13061319}
13071320
13081321#[ test]
1322+ #[ cfg( not( miri) ) ]
13091323fn test_str_default ( ) {
13101324 use std:: default:: Default ;
13111325
@@ -1365,6 +1379,7 @@ fn test_bool_from_str() {
13651379 assert_eq ! ( "not even a boolean" . parse:: <bool >( ) . ok( ) , None ) ;
13661380}
13671381
1382+ #[ cfg( not( miri) ) ]
13681383fn check_contains_all_substrings ( s : & str ) {
13691384 assert ! ( s. contains( "" ) ) ;
13701385 for i in 0 ..s. len ( ) {
@@ -1375,6 +1390,7 @@ fn check_contains_all_substrings(s: &str) {
13751390}
13761391
13771392#[ test]
1393+ #[ cfg( not( miri) ) ]
13781394fn strslice_issue_16589 ( ) {
13791395 assert ! ( "bananas" . contains( "nana" ) ) ;
13801396
@@ -1384,13 +1400,15 @@ fn strslice_issue_16589() {
13841400}
13851401
13861402#[ test]
1403+ #[ cfg( not( miri) ) ]
13871404fn strslice_issue_16878 ( ) {
13881405 assert ! ( !"1234567ah012345678901ah" . contains( "hah" ) ) ;
13891406 assert ! ( !"00abc01234567890123456789abc" . contains( "bcabc" ) ) ;
13901407}
13911408
13921409
13931410#[ test]
1411+ #[ cfg( not( miri) ) ]
13941412fn test_strslice_contains ( ) {
13951413 let x = "There are moments, Jeeves, when one asks oneself, 'Do trousers matter?'" ;
13961414 check_contains_all_substrings ( x) ;
@@ -1528,6 +1546,7 @@ fn trim_ws() {
15281546
15291547#[ test]
15301548fn to_lowercase ( ) {
1549+ #[ cfg( not( miri) ) ]
15311550 assert_eq ! ( "" . to_lowercase( ) , "" ) ;
15321551 assert_eq ! ( "AÉDžaé " . to_lowercase( ) , "aédžaé " ) ;
15331552
@@ -1561,6 +1580,7 @@ fn to_lowercase() {
15611580
15621581#[ test]
15631582fn to_uppercase ( ) {
1583+ #[ cfg( not( miri) ) ]
15641584 assert_eq ! ( "" . to_uppercase( ) , "" ) ;
15651585 assert_eq ! ( "aéDžßfiᾀ" . to_uppercase( ) , "AÉDŽSSFIἈΙ" ) ;
15661586}
@@ -1592,6 +1612,7 @@ fn test_cow_from() {
15921612}
15931613
15941614#[ test]
1615+ #[ cfg( not( miri) ) ]
15951616fn test_repeat ( ) {
15961617 assert_eq ! ( "" . repeat( 3 ) , "" ) ;
15971618 assert_eq ! ( "abc" . repeat( 0 ) , "" ) ;
0 commit comments