From b8a0b86282198d1a9b1e10ca6c961571e392200d Mon Sep 17 00:00:00 2001 From: Kent Gruber Date: Wed, 2 May 2018 13:17:46 -0400 Subject: [PATCH] add test for GetIntsWith function with documented TODO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I didn’t really understand this function entirely. --- network/meta_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/network/meta_test.go b/network/meta_test.go index 5806178b..ce8694d1 100644 --- a/network/meta_test.go +++ b/network/meta_test.go @@ -31,3 +31,17 @@ func TestMetaSet(t *testing.T) { t.Error("unable to set meta data in struct") } } + +// TODO document what this does, not too clear, +// at least for me today lolololol +func TestMetaGetIntsWith(t *testing.T) { + example := buildExampleMeta() + example.m["picat"] = "3," + + exp := []int{4, 3} + got := example.GetIntsWith("picat", 4, false) + + if exp[0] != got[0] { + t.Fatalf("expected '%v', got '%v'", exp, got) + } +}