mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 04:59:25 -07:00
add test for AddIfNew
This commit is contained in:
parent
dcc7ca2cbd
commit
65b28e028f
1 changed files with 9 additions and 0 deletions
|
@ -171,3 +171,12 @@ func TestGetByIp(t *testing.T) {
|
||||||
t.Fatalf("expected '%v', got '%v'", exp, got)
|
t.Fatalf("expected '%v', got '%v'", exp, got)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestAddIfNew(t *testing.T) {
|
||||||
|
exampleLAN := buildExampleLAN()
|
||||||
|
iface, _ := FindInterface("")
|
||||||
|
// won't add our own IP address
|
||||||
|
if exampleLAN.AddIfNew(iface.IpAddress, iface.HwAddress) != nil {
|
||||||
|
t.Error("added address that should've been ignored ( your own )")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue