File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,9 @@ fn compare() {
199
199
let v6_1 = "[2001:db8:f00::1002]:23456" . parse :: < SocketAddrV6 > ( ) . unwrap ( ) ;
200
200
let v6_2 = "[2001:db8:f00::2001]:12345" . parse :: < SocketAddrV6 > ( ) . unwrap ( ) ;
201
201
let v6_3 = "[2001:db8:f00::2001]:23456" . parse :: < SocketAddrV6 > ( ) . unwrap ( ) ;
202
+ let v6_4 = "[2001:db8:f00::2001%42]:23456" . parse :: < SocketAddrV6 > ( ) . unwrap ( ) ;
203
+ let mut v6_5 = "[2001:db8:f00::2001]:23456" . parse :: < SocketAddrV6 > ( ) . unwrap ( ) ;
204
+ v6_5. set_flowinfo ( 17 ) ;
202
205
203
206
// equality
204
207
assert_eq ! ( v4_1, v4_1) ;
@@ -207,6 +210,8 @@ fn compare() {
207
210
assert_eq ! ( SocketAddr :: V6 ( v6_1) , SocketAddr :: V6 ( v6_1) ) ;
208
211
assert ! ( v4_1 != v4_2) ;
209
212
assert ! ( v6_1 != v6_2) ;
213
+ assert ! ( v6_3 != v6_4) ;
214
+ assert ! ( v6_3 != v6_5) ;
210
215
211
216
// compare different addresses
212
217
assert ! ( v4_1 < v4_2) ;
@@ -226,6 +231,12 @@ fn compare() {
226
231
assert ! ( v4_3 > v4_1) ;
227
232
assert ! ( v6_3 > v6_1) ;
228
233
234
+ // compare the same address with different scope_id
235
+ assert ! ( v6_3 < v6_4) ;
236
+
237
+ // compare the same address with different flowinfo
238
+ assert ! ( v6_3 < v6_5) ;
239
+
229
240
// compare with an inferred right-hand side
230
241
assert_eq ! ( v4_1, "224.120.45.1:23456" . parse( ) . unwrap( ) ) ;
231
242
assert_eq ! ( v6_1, "[2001:db8:f00::1002]:23456" . parse( ) . unwrap( ) ) ;
You can’t perform that action at this time.
0 commit comments