From 0b55b645b1624685d85613c53b6698c65287f103 Mon Sep 17 00:00:00 2001 From: Kent Gruber Date: Wed, 2 May 2018 13:58:42 -0400 Subject: [PATCH] add test for Find function --- network/aliases_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/network/aliases_test.go b/network/aliases_test.go index e420de91..b908ff06 100644 --- a/network/aliases_test.go +++ b/network/aliases_test.go @@ -52,3 +52,19 @@ func TestAliasesSet(t *testing.T) { t.Error("unable to get set alias") } } + +func TestAliasesFind(t *testing.T) { + exampleAliases := buildExampleAlaises() + exampleAliases.data = make(map[string]string) + err := exampleAliases.Set("pi:ca:tw:as:he:re", "picat") + if err != nil { + t.Error(err) + } + mac, found := exampleAliases.Find("picat") + if !found { + t.Error("unable to find mac address for alias") + } + if mac != "pi:ca:tw:as:he:re" { + t.Error("unable to find correct mac address for alias") + } +}