@@ -286,7 +286,7 @@ func (s *Suite) TestDeleteRoutes(c *check.C) {
286
286
}
287
287
288
288
var (
289
- ipp = func (s string ) types. IPPrefix { return types . IPPrefix ( netip .MustParsePrefix (s ) ) }
289
+ ipp = func (s string ) netip. Prefix { return netip .MustParsePrefix (s ) }
290
290
mkNode = func (nid types.NodeID ) types.Node {
291
291
return types.Node {ID : nid }
292
292
}
@@ -297,7 +297,7 @@ var np = func(nid types.NodeID) *types.Node {
297
297
return & no
298
298
}
299
299
300
- var r = func (id uint , nid types.NodeID , prefix types. IPPrefix , enabled , primary bool ) types.Route {
300
+ var r = func (id uint , nid types.NodeID , prefix netip. Prefix , enabled , primary bool ) types.Route {
301
301
return types.Route {
302
302
Model : gorm.Model {
303
303
ID : id ,
@@ -309,7 +309,7 @@ var r = func(id uint, nid types.NodeID, prefix types.IPPrefix, enabled, primary
309
309
}
310
310
}
311
311
312
- var rp = func (id uint , nid types.NodeID , prefix types. IPPrefix , enabled , primary bool ) * types.Route {
312
+ var rp = func (id uint , nid types.NodeID , prefix netip. Prefix , enabled , primary bool ) * types.Route {
313
313
ro := r (id , nid , prefix , enabled , primary )
314
314
return & ro
315
315
}
@@ -1065,7 +1065,7 @@ func TestFailoverRouteTx(t *testing.T) {
1065
1065
}
1066
1066
1067
1067
func TestFailoverRoute (t * testing.T ) {
1068
- r := func (id uint , nid types.NodeID , prefix types. IPPrefix , enabled , primary bool ) types.Route {
1068
+ r := func (id uint , nid types.NodeID , prefix netip. Prefix , enabled , primary bool ) types.Route {
1069
1069
return types.Route {
1070
1070
Model : gorm.Model {
1071
1071
ID : id ,
@@ -1078,7 +1078,7 @@ func TestFailoverRoute(t *testing.T) {
1078
1078
IsPrimary : primary ,
1079
1079
}
1080
1080
}
1081
- rp := func (id uint , nid types.NodeID , prefix types. IPPrefix , enabled , primary bool ) * types.Route {
1081
+ rp := func (id uint , nid types.NodeID , prefix netip. Prefix , enabled , primary bool ) * types.Route {
1082
1082
ro := r (id , nid , prefix , enabled , primary )
1083
1083
return & ro
1084
1084
}
@@ -1201,13 +1201,6 @@ func TestFailoverRoute(t *testing.T) {
1201
1201
},
1202
1202
}
1203
1203
1204
- cmps := append (
1205
- util .Comparers ,
1206
- cmp .Comparer (func (x , y types.IPPrefix ) bool {
1207
- return netip .Prefix (x ) == netip .Prefix (y )
1208
- }),
1209
- )
1210
-
1211
1204
for _ , tt := range tests {
1212
1205
t .Run (tt .name , func (t * testing.T ) {
1213
1206
gotf := failoverRoute (smap (tt .isConnected ), & tt .failingRoute , tt .routes )
@@ -1231,7 +1224,7 @@ func TestFailoverRoute(t *testing.T) {
1231
1224
"old" : gotf .old ,
1232
1225
}
1233
1226
1234
- if diff := cmp .Diff (want , got , cmps ... ); diff != "" {
1227
+ if diff := cmp .Diff (want , got , util . Comparers ... ); diff != "" {
1235
1228
t .Fatalf ("failoverRoute unexpected result (-want +got):\n %s" , diff )
1236
1229
}
1237
1230
}
0 commit comments