@@ -148,39 +148,44 @@ where
148
148
None
149
149
}
150
150
151
- #[ test]
152
- fn test_overlapping ( ) {
153
- use rustc_span:: DUMMY_SP ;
154
-
155
- let sp = |s, e| SpannedRange {
156
- span : DUMMY_SP ,
157
- node : ( s, e) ,
158
- } ;
159
-
160
- assert_eq ! ( None , overlapping:: <u8 >( & [ ] ) ) ;
161
- assert_eq ! ( None , overlapping( & [ sp( 1 , EndBound :: Included ( 4 ) ) ] ) ) ;
162
- assert_eq ! (
163
- None ,
164
- overlapping( & [ sp( 1 , EndBound :: Included ( 4 ) ) , sp( 5 , EndBound :: Included ( 6 ) ) ] )
165
- ) ;
166
- assert_eq ! (
167
- None ,
168
- overlapping( & [
169
- sp( 1 , EndBound :: Included ( 4 ) ) ,
170
- sp( 5 , EndBound :: Included ( 6 ) ) ,
171
- sp( 10 , EndBound :: Included ( 11 ) )
172
- ] , )
173
- ) ;
174
- assert_eq ! (
175
- Some ( ( & sp( 1 , EndBound :: Included ( 4 ) ) , & sp( 3 , EndBound :: Included ( 6 ) ) ) ) ,
176
- overlapping( & [ sp( 1 , EndBound :: Included ( 4 ) ) , sp( 3 , EndBound :: Included ( 6 ) ) ] )
177
- ) ;
178
- assert_eq ! (
179
- Some ( ( & sp( 5 , EndBound :: Included ( 6 ) ) , & sp( 6 , EndBound :: Included ( 11 ) ) ) ) ,
180
- overlapping( & [
181
- sp( 1 , EndBound :: Included ( 4 ) ) ,
182
- sp( 5 , EndBound :: Included ( 6 ) ) ,
183
- sp( 6 , EndBound :: Included ( 11 ) )
184
- ] , )
185
- ) ;
151
+ #[ cfg( test) ]
152
+ mod test {
153
+ use super :: { EndBound , SpannedRange } ;
154
+
155
+ #[ test]
156
+ fn overlapping ( ) {
157
+ use rustc_span:: DUMMY_SP ;
158
+
159
+ let sp = |s, e| SpannedRange {
160
+ span : DUMMY_SP ,
161
+ node : ( s, e) ,
162
+ } ;
163
+
164
+ assert_eq ! ( None , super :: overlapping:: <u8 >( & [ ] ) ) ;
165
+ assert_eq ! ( None , super :: overlapping( & [ sp( 1 , EndBound :: Included ( 4 ) ) ] ) ) ;
166
+ assert_eq ! (
167
+ None ,
168
+ super :: overlapping( & [ sp( 1 , EndBound :: Included ( 4 ) ) , sp( 5 , EndBound :: Included ( 6 ) ) ] )
169
+ ) ;
170
+ assert_eq ! (
171
+ None ,
172
+ super :: overlapping( & [
173
+ sp( 1 , EndBound :: Included ( 4 ) ) ,
174
+ sp( 5 , EndBound :: Included ( 6 ) ) ,
175
+ sp( 10 , EndBound :: Included ( 11 ) )
176
+ ] , )
177
+ ) ;
178
+ assert_eq ! (
179
+ Some ( ( & sp( 1 , EndBound :: Included ( 4 ) ) , & sp( 3 , EndBound :: Included ( 6 ) ) ) ) ,
180
+ super :: overlapping( & [ sp( 1 , EndBound :: Included ( 4 ) ) , sp( 3 , EndBound :: Included ( 6 ) ) ] )
181
+ ) ;
182
+ assert_eq ! (
183
+ Some ( ( & sp( 5 , EndBound :: Included ( 6 ) ) , & sp( 6 , EndBound :: Included ( 11 ) ) ) ) ,
184
+ super :: overlapping( & [
185
+ sp( 1 , EndBound :: Included ( 4 ) ) ,
186
+ sp( 5 , EndBound :: Included ( 6 ) ) ,
187
+ sp( 6 , EndBound :: Included ( 11 ) )
188
+ ] , )
189
+ ) ;
190
+ }
186
191
}
0 commit comments