From c71113b321f512d3c97bd2375ba2f63a66c7a719 Mon Sep 17 00:00:00 2001 From: Kent Gruber Date: Tue, 1 May 2018 15:45:43 -0400 Subject: [PATCH 1/3] start adding tests for oui related functions in the network package this is the base for the test --- network/oui_test.go | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 network/oui_test.go diff --git a/network/oui_test.go b/network/oui_test.go new file mode 100644 index 00000000..06777c76 --- /dev/null +++ b/network/oui_test.go @@ -0,0 +1,3 @@ +package network + +import "testing" From 90676d0289eb7358d3392a8913eda44a826a6cb7 Mon Sep 17 00:00:00 2001 From: Kent Gruber Date: Tue, 1 May 2018 15:47:05 -0400 Subject: [PATCH 2/3] add basic oui variable check should contain information for the known organizational unique identifiers --- network/oui_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/network/oui_test.go b/network/oui_test.go index 06777c76..e54e6720 100644 --- a/network/oui_test.go +++ b/network/oui_test.go @@ -1,3 +1,9 @@ package network import "testing" + +func TestOuiVar(t *testing.T) { + if len(oui) <= 0 { + t.Error("unable to find any oui infromation") + } +} From 29ec4edc633cc167b91413f99a876f744bf6375e Mon Sep 17 00:00:00 2001 From: Kent Gruber Date: Tue, 1 May 2018 15:47:33 -0400 Subject: [PATCH 3/3] add test for OuiLookup --- network/oui_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/network/oui_test.go b/network/oui_test.go index e54e6720..1973d81a 100644 --- a/network/oui_test.go +++ b/network/oui_test.go @@ -7,3 +7,12 @@ func TestOuiVar(t *testing.T) { t.Error("unable to find any oui infromation") } } + +func TestOuiLookup(t *testing.T) { + exampleMac := "e0:0c:7f:XX:XX:XX" + exp := "Nintendo Co." + got := OuiLookup(exampleMac) + if got != exp { + t.Fatalf("expected '%s', got '%s'", exp, got) + } +}