From 7a6cf8f197676fb54737a0440f56776f28310c6f Mon Sep 17 00:00:00 2001 From: Kent Gruber Date: Wed, 2 May 2018 13:20:38 -0400 Subject: [PATCH] add test for Empty function --- network/meta_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/network/meta_test.go b/network/meta_test.go index 543959c3..6850dd84 100644 --- a/network/meta_test.go +++ b/network/meta_test.go @@ -85,3 +85,18 @@ func TestMetaEach(t *testing.T) { t.Fatalf("expected '%v', got '%v'", exp, got) } } + +func TestMetaEmpty(t *testing.T) { + example := buildExampleMeta() + + if !example.Empty() { + t.Error("unable to check if filled struct is empty") + } + + example.m["picat"] = true //fill struct so not empty + + if example.Empty() { + t.Error("unable to check if filled struct is empty") + } + +}