mirror of
https://github.com/bettercap/bettercap
synced 2025-07-16 10:03:39 -07:00
add test for GetByIp
possible TODO: rename GetByIp to GetByIP like golint says to do?
This commit is contained in:
parent
4b82e917c7
commit
dcc7ca2cbd
1 changed files with 12 additions and 0 deletions
|
@ -159,3 +159,15 @@ func TestEachHost(t *testing.T) {
|
||||||
t.Fatalf("expected '%d', got '%d'", exp, got)
|
t.Fatalf("expected '%d', got '%d'", exp, got)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGetByIp(t *testing.T) {
|
||||||
|
exampleLAN := buildExampleLAN()
|
||||||
|
exampleEndpoint := buildExampleEndpoint()
|
||||||
|
exampleLAN.hosts[exampleEndpoint.HwAddress] = exampleEndpoint
|
||||||
|
|
||||||
|
exp := exampleEndpoint
|
||||||
|
got := exampleLAN.GetByIp(exampleEndpoint.IpAddress)
|
||||||
|
if got != exp {
|
||||||
|
t.Fatalf("expected '%v', got '%v'", exp, got)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue