@@ -1236,7 +1236,7 @@ fn test_rsplitnator() {
1236
1236
1237
1237
#[ test]
1238
1238
fn test_split_iterators_size_hint ( ) {
1239
- #[ derive( Copy , Clone ) ]
1239
+ #[ derive( Copy , Clone , PartialEq , Eq ) ]
1240
1240
enum Bounds {
1241
1241
Lower ,
1242
1242
Upper ,
@@ -1267,8 +1267,9 @@ fn test_split_iterators_size_hint() {
1267
1267
1268
1268
// p: predicate, b: bound selection
1269
1269
for ( p, b) in [
1270
- // with a predicate always returning false, the split*-iterators
1271
- // become maximally short, so the size_hint lower bounds are tight
1270
+ // with a predicate always returning false, the non-inclusive
1271
+ // split*-iterators become maximally short, so the size_hint
1272
+ // lower bounds are tight
1272
1273
( ( |_| false ) as fn ( & _) -> _ , Bounds :: Lower ) ,
1273
1274
// with a predicate always returning true, the split*-iterators
1274
1275
// become maximally long, so the size_hint upper bounds are tight
@@ -1279,8 +1280,10 @@ fn test_split_iterators_size_hint() {
1279
1280
1280
1281
a ( v. split ( p) , b, "split" ) ;
1281
1282
a ( v. split_mut ( p) , b, "split_mut" ) ;
1282
- a ( v. split_inclusive ( p) , b, "split_inclusive" ) ;
1283
- a ( v. split_inclusive_mut ( p) , b, "split_inclusive_mut" ) ;
1283
+ if b == Bounds :: Upper {
1284
+ a ( v. split_inclusive ( p) , b, "split_inclusive" ) ;
1285
+ a ( v. split_inclusive_mut ( p) , b, "split_inclusive_mut" ) ;
1286
+ }
1284
1287
a ( v. rsplit ( p) , b, "rsplit" ) ;
1285
1288
a ( v. rsplit_mut ( p) , b, "rsplit_mut" ) ;
1286
1289
0 commit comments