mirror of
https://github.com/go-micro/go-micro.git
synced 2025-06-18 22:17:44 +02:00
Move proxy/router
This commit is contained in:
24
router/route_test.go
Normal file
24
router/route_test.go
Normal file
@ -0,0 +1,24 @@
|
||||
package router
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestHash(t *testing.T) {
|
||||
route1 := Route{
|
||||
Service: "dest.svc",
|
||||
Gateway: "dest.gw",
|
||||
Network: "dest.network",
|
||||
Link: "det.link",
|
||||
Metric: 10,
|
||||
}
|
||||
|
||||
// make a copy
|
||||
route2 := route1
|
||||
|
||||
route1Hash := route1.Hash()
|
||||
route2Hash := route2.Hash()
|
||||
|
||||
// we should get the same hash
|
||||
if route1Hash != route2Hash {
|
||||
t.Errorf("identical routes result in different hashes")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user