add test for GetIntsWith function with documented TODO

I didn’t really understand this function entirely.
This commit is contained in:
Kent Gruber 2018-05-02 13:17:46 -04:00
commit b8a0b86282

View file

@ -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)
}
}