@@ -82,7 +82,7 @@ pub fn main() {
82
82
short. next ( ) ;
83
83
assert_eq ! ( long. size_hint( ) , ( 255 , Some ( 255 ) ) ) ;
84
84
assert_eq ! ( short. size_hint( ) , ( 0 , Some ( 0 ) ) ) ;
85
- assert_eq ! ( short, RangeInclusive :: Empty { at : 42 } ) ;
85
+ assert_eq ! ( short, 1 ... 0 ) ;
86
86
87
87
assert_eq ! ( long. len( ) , 255 ) ;
88
88
assert_eq ! ( short. len( ) , 0 ) ;
@@ -97,28 +97,28 @@ pub fn main() {
97
97
for i in 3 ...251 {
98
98
assert_eq ! ( long. next( ) , Some ( i) ) ;
99
99
}
100
- assert_eq ! ( long, RangeInclusive :: Empty { at : 251 } ) ;
100
+ assert_eq ! ( long, 1 ... 0 ) ;
101
101
102
102
// check underflow
103
103
let mut narrow = 1 ...0 ;
104
104
assert_eq ! ( narrow. next_back( ) , None ) ;
105
- assert_eq ! ( narrow, RangeInclusive :: Empty { at : 0 } ) ;
105
+ assert_eq ! ( narrow, 1 ... 0 ) ;
106
106
let mut zero = 0u8 ...0 ;
107
107
assert_eq ! ( zero. next_back( ) , Some ( 0 ) ) ;
108
108
assert_eq ! ( zero. next_back( ) , None ) ;
109
- assert_eq ! ( zero, RangeInclusive :: Empty { at : 0 } ) ;
109
+ assert_eq ! ( zero, 1 ... 0 ) ;
110
110
let mut high = 255u8 ...255 ;
111
111
assert_eq ! ( high. next_back( ) , Some ( 255 ) ) ;
112
112
assert_eq ! ( high. next_back( ) , None ) ;
113
- assert_eq ! ( high, RangeInclusive :: Empty { at : 255 } ) ;
113
+ assert_eq ! ( high, 1 ... 0 ) ;
114
114
115
115
// what happens if you have a nonsense range?
116
116
let mut nonsense = 10 ...5 ;
117
117
assert_eq ! ( nonsense. next( ) , None ) ;
118
- assert_eq ! ( nonsense, RangeInclusive :: Empty { at : 10 } ) ;
118
+ assert_eq ! ( nonsense, 10 ... 5 ) ;
119
119
120
120
// output
121
121
assert_eq ! ( format!( "{:?}" , 0 ...10 ) , "0...10" ) ;
122
122
assert_eq ! ( format!( "{:?}" , ...10 ) , "...10" ) ;
123
- assert_eq ! ( format!( "{:?}" , long) , "[empty range @ 251] " ) ;
123
+ assert_eq ! ( format!( "{:?}" , long) , "1...0 " ) ;
124
124
}
0 commit comments