mirror of
https://github.com/bettercap/bettercap
synced 2025-07-15 09:33:40 -07:00
add test for GetAlias
This commit is contained in:
parent
65b28e028f
commit
d641fbf5c3
1 changed files with 12 additions and 0 deletions
|
@ -180,3 +180,15 @@ func TestAddIfNew(t *testing.T) {
|
|||
t.Error("added address that should've been ignored ( your own )")
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetAlias(t *testing.T) {
|
||||
exampleAlias := "picat"
|
||||
exampleLAN := buildExampleLAN()
|
||||
exampleEndpoint := buildExampleEndpoint()
|
||||
exampleLAN.hosts[exampleEndpoint.HwAddress] = exampleEndpoint
|
||||
exp := exampleAlias
|
||||
got := exampleLAN.GetAlias(exampleEndpoint.HwAddress)
|
||||
if got != exp {
|
||||
t.Fatalf("expected '%v', got '%v'", exp, got)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue