diff --git a/container/mts/meta/meta_test.go b/container/mts/meta/meta_test.go index 38e4dbb6..9316ce55 100644 --- a/container/mts/meta/meta_test.go +++ b/container/mts/meta/meta_test.go @@ -189,6 +189,23 @@ func TestGetAll(t *testing.T) { } } +// TestGetAllAsMap checks that GetAllAsMap will correctly return a map of meta +// keys and values from a slice of meta. +func TestGetAllAsMap(t *testing.T) { + tstMeta := append([]byte{0x00, 0x10, 0x00, 0x12}, "loc=a,b,c\tts=12345"...) + want := map[string]string{ + "loc": "a,b,c", + "ts": "12345", + } + got, err := GetAllAsMap(tstMeta) + if err != nil { + t.Errorf("Unexpected error: %v\n", err) + } + if !reflect.DeepEqual(got, want) { + t.Errorf("Did not get expected out. \nGot : %v, \nWant: %v\n", got, want) + } +} + // TestKeys checks that we can successfully get keys from some metadata using // the meta.Keys method. func TestKeys(t *testing.T) {