mirror of https://bitbucket.org/ausocean/av.git
stream/mts/meta_test.go: added TestAll func to make sure Meta.All is working correctly
This commit is contained in:
parent
3bb1ca9379
commit
17d06f49f4
|
@ -28,6 +28,7 @@ LICENSE
|
|||
package mts
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
@ -66,6 +67,22 @@ func TestUpdate(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestAll(t *testing.T) {
|
||||
meta := NewMeta()
|
||||
tstMap := map[string]string{
|
||||
"loc": "a,b,c",
|
||||
"ts": "12345678",
|
||||
}
|
||||
|
||||
meta.Add("loc", "a,b,c")
|
||||
meta.Add("ts", "12345678")
|
||||
metaMap := meta.All()
|
||||
|
||||
if !reflect.DeepEqual(metaMap, tstMap) {
|
||||
t.Errorf("Map not correct. Got: %v, want: %v", metaMap, tstMap)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: test all
|
||||
// TODO: test get when key exists
|
||||
// TODO: test get when key doesn't exist
|
||||
|
|
Loading…
Reference in New Issue