1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-07-12 22:41:07 +02:00

feat: add test framework & refactor RPC server (#2579)

Co-authored-by: Rene Jochum <rene@jochum.dev>
This commit is contained in:
David Brouwer
2022-10-20 13:00:50 +02:00
committed by GitHub
parent c25dee7c8a
commit a3980c2308
54 changed files with 3703 additions and 2497 deletions

View File

@ -54,24 +54,3 @@ func TestExtractor(t *testing.T) {
}
}
}
func TestAppendPrivateBlocks(t *testing.T) {
tests := []struct {
addr string
expect bool
}{
{addr: "9.134.71.34", expect: true},
{addr: "8.10.110.34", expect: false}, // not in private blocks
}
AppendPrivateBlocks("9.134.0.0/16")
for _, test := range tests {
t.Run(test.addr, func(t *testing.T) {
res := isPrivateIP(test.addr)
if res != test.expect {
t.Fatalf("expected %t got %t", test.expect, res)
}
})
}
}