@@ -31,6 +31,7 @@ fn test_rfind() {
31
31
}
32
32
33
33
#[ test]
34
+ #[ cfg( not( miri) ) ]
34
35
fn test_collect ( ) {
35
36
let empty = "" ;
36
37
let s: String = empty. chars ( ) . collect ( ) ;
@@ -118,6 +119,7 @@ fn test_concat_for_different_types() {
118
119
#[ test]
119
120
fn test_concat_for_different_lengths ( ) {
120
121
let empty: & [ & str ] = & [ ] ;
122
+ #[ cfg( not( miri) ) ]
121
123
test_concat ! ( "" , empty) ;
122
124
test_concat ! ( "a" , [ "a" ] ) ;
123
125
test_concat ! ( "ab" , [ "a" , "b" ] ) ;
@@ -146,6 +148,7 @@ fn test_join_for_different_types() {
146
148
#[ test]
147
149
fn test_join_for_different_lengths ( ) {
148
150
let empty: & [ & str ] = & [ ] ;
151
+ #[ cfg( not( miri) ) ]
149
152
test_join ! ( "" , empty, "-" ) ;
150
153
test_join ! ( "a" , [ "a" ] , "-" ) ;
151
154
test_join ! ( "a-b" , [ "a" , "b" ] , "-" ) ;
@@ -159,13 +162,15 @@ fn test_join_for_different_lengths_with_long_separator() {
159
162
assert_eq ! ( "~~~~~" . len( ) , 15 ) ;
160
163
161
164
let empty: & [ & str ] = & [ ] ;
165
+ #[ cfg( not( miri) ) ]
162
166
test_join ! ( "" , empty, "~~~~~" ) ;
163
167
test_join ! ( "a" , [ "a" ] , "~~~~~" ) ;
164
168
test_join ! ( "a~~~~~b" , [ "a" , "b" ] , "~~~~~" ) ;
165
169
test_join ! ( "~~~~~a~~~~~bc" , [ "" , "a" , "bc" ] , "~~~~~" ) ;
166
170
}
167
171
168
172
#[ test]
173
+ #[ cfg( not( miri) ) ]
169
174
fn test_unsafe_slice ( ) {
170
175
assert_eq ! ( "ab" , unsafe { "abc" . get_unchecked( 0 ..2 ) } ) ;
171
176
assert_eq ! ( "bc" , unsafe { "abc" . get_unchecked( 1 ..3 ) } ) ;
@@ -238,6 +243,7 @@ fn test_replacen() {
238
243
#[ test]
239
244
fn test_replace ( ) {
240
245
let a = "a" ;
246
+ #[ cfg( not( miri) ) ]
241
247
assert_eq ! ( "" . replace( a, "b" ) , "" ) ;
242
248
assert_eq ! ( "a" . replace( a, "b" ) , "b" ) ;
243
249
assert_eq ! ( "ab" . replace( a, "b" ) , "bb" ) ;
@@ -297,6 +303,7 @@ fn test_replace_pattern() {
297
303
// The current implementation of SliceIndex fails to handle methods
298
304
// orthogonally from range types; therefore, it is worth testing
299
305
// all of the indexing operations on each input.
306
+ #[ cfg( not( miri) ) ]
300
307
mod slice_index {
301
308
// Test a slicing operation **that should succeed,**
302
309
// testing it on all of the indexing methods.
@@ -679,6 +686,7 @@ fn test_str_slice_rangetoinclusive_ok() {
679
686
680
687
#[ test]
681
688
#[ should_panic]
689
+ #[ cfg( not( miri) ) ]
682
690
fn test_str_slice_rangetoinclusive_notok ( ) {
683
691
let s = "abcαβγ" ;
684
692
& s[ ..=3 ] ;
@@ -694,6 +702,7 @@ fn test_str_slicemut_rangetoinclusive_ok() {
694
702
695
703
#[ test]
696
704
#[ should_panic]
705
+ #[ cfg( not( miri) ) ]
697
706
fn test_str_slicemut_rangetoinclusive_notok ( ) {
698
707
let mut s = "abcαβγ" . to_owned ( ) ;
699
708
let s: & mut str = & mut s;
@@ -883,6 +892,7 @@ fn test_as_bytes() {
883
892
884
893
#[ test]
885
894
#[ should_panic]
895
+ #[ cfg( not( miri) ) ]
886
896
fn test_as_bytes_fail ( ) {
887
897
// Don't double free. (I'm not sure if this exercises the
888
898
// original problem code path anymore.)
@@ -972,6 +982,7 @@ fn test_split_at_mut() {
972
982
973
983
#[ test]
974
984
#[ should_panic]
985
+ #[ cfg( not( miri) ) ]
975
986
fn test_split_at_boundscheck ( ) {
976
987
let s = "ศไทย中华Việt Nam" ;
977
988
s. split_at ( 1 ) ;
@@ -1066,6 +1077,7 @@ fn test_rev_iterator() {
1066
1077
}
1067
1078
1068
1079
#[ test]
1080
+ #[ cfg( not( miri) ) ]
1069
1081
fn test_chars_decoding ( ) {
1070
1082
let mut bytes = [ 0 ; 4 ] ;
1071
1083
for c in ( 0 ..0x110000 ) . filter_map ( std:: char:: from_u32) {
@@ -1077,6 +1089,7 @@ fn test_chars_decoding() {
1077
1089
}
1078
1090
1079
1091
#[ test]
1092
+ #[ cfg( not( miri) ) ]
1080
1093
fn test_chars_rev_decoding ( ) {
1081
1094
let mut bytes = [ 0 ; 4 ] ;
1082
1095
for c in ( 0 ..0x110000 ) . filter_map ( std:: char:: from_u32) {
@@ -1306,6 +1319,7 @@ fn test_splitator() {
1306
1319
}
1307
1320
1308
1321
#[ test]
1322
+ #[ cfg( not( miri) ) ]
1309
1323
fn test_str_default ( ) {
1310
1324
use std:: default:: Default ;
1311
1325
@@ -1365,6 +1379,7 @@ fn test_bool_from_str() {
1365
1379
assert_eq ! ( "not even a boolean" . parse:: <bool >( ) . ok( ) , None ) ;
1366
1380
}
1367
1381
1382
+ #[ cfg( not( miri) ) ]
1368
1383
fn check_contains_all_substrings ( s : & str ) {
1369
1384
assert ! ( s. contains( "" ) ) ;
1370
1385
for i in 0 ..s. len ( ) {
@@ -1375,6 +1390,7 @@ fn check_contains_all_substrings(s: &str) {
1375
1390
}
1376
1391
1377
1392
#[ test]
1393
+ #[ cfg( not( miri) ) ]
1378
1394
fn strslice_issue_16589 ( ) {
1379
1395
assert ! ( "bananas" . contains( "nana" ) ) ;
1380
1396
@@ -1384,13 +1400,15 @@ fn strslice_issue_16589() {
1384
1400
}
1385
1401
1386
1402
#[ test]
1403
+ #[ cfg( not( miri) ) ]
1387
1404
fn strslice_issue_16878 ( ) {
1388
1405
assert ! ( !"1234567ah012345678901ah" . contains( "hah" ) ) ;
1389
1406
assert ! ( !"00abc01234567890123456789abc" . contains( "bcabc" ) ) ;
1390
1407
}
1391
1408
1392
1409
1393
1410
#[ test]
1411
+ #[ cfg( not( miri) ) ]
1394
1412
fn test_strslice_contains ( ) {
1395
1413
let x = "There are moments, Jeeves, when one asks oneself, 'Do trousers matter?'" ;
1396
1414
check_contains_all_substrings ( x) ;
@@ -1528,6 +1546,7 @@ fn trim_ws() {
1528
1546
1529
1547
#[ test]
1530
1548
fn to_lowercase ( ) {
1549
+ #[ cfg( not( miri) ) ]
1531
1550
assert_eq ! ( "" . to_lowercase( ) , "" ) ;
1532
1551
assert_eq ! ( "AÉDžaé " . to_lowercase( ) , "aédžaé " ) ;
1533
1552
@@ -1561,6 +1580,7 @@ fn to_lowercase() {
1561
1580
1562
1581
#[ test]
1563
1582
fn to_uppercase ( ) {
1583
+ #[ cfg( not( miri) ) ]
1564
1584
assert_eq ! ( "" . to_uppercase( ) , "" ) ;
1565
1585
assert_eq ! ( "aéDžßfiᾀ" . to_uppercase( ) , "AÉDŽSSFIἈΙ" ) ;
1566
1586
}
@@ -1592,6 +1612,7 @@ fn test_cow_from() {
1592
1612
}
1593
1613
1594
1614
#[ test]
1615
+ #[ cfg( not( miri) ) ]
1595
1616
fn test_repeat ( ) {
1596
1617
assert_eq ! ( "" . repeat( 3 ) , "" ) ;
1597
1618
assert_eq ! ( "abc" . repeat( 0 ) , "" ) ;
0 commit comments