From d3c8afb3fb6a8f143f8b60950af7cefb5c1d2cf0 Mon Sep 17 00:00:00 2001 From: Kent Gruber Date: Tue, 1 May 2018 15:04:55 -0400 Subject: [PATCH] add test for shouldIgnore --- network/lan_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/network/lan_test.go b/network/lan_test.go index ba069fbb..7cdc7ef8 100644 --- a/network/lan_test.go +++ b/network/lan_test.go @@ -192,3 +192,18 @@ func TestGetAlias(t *testing.T) { t.Fatalf("expected '%v', got '%v'", exp, got) } } + +func TestShouldIgnore(t *testing.T) { + exampleLAN := buildExampleLAN() + iface, _ := FindInterface("") + gateway, _ := FindGateway(iface) + exp := true + got := exampleLAN.shouldIgnore(iface.IpAddress, iface.HwAddress) + if got != exp { + t.Fatalf("expected '%v', got '%v'", exp, got) + } + got = exampleLAN.shouldIgnore(gateway.IpAddress, gateway.HwAddress) + if got != exp { + t.Fatalf("expected '%v', got '%v'", exp, got) + } +}