mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-30 05:01:44 +00:00
Use an interface for tags. (#195)
* Use an interface for tags. * rename TagSet to TagMap. * add documentation to TagMap.
This commit is contained in:
committed by
Anton Kaliaev
parent
a807b5db57
commit
75345c2046
@ -4,13 +4,14 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/tendermint/tmlibs/pubsub"
|
||||
"github.com/tendermint/tmlibs/pubsub/query"
|
||||
)
|
||||
|
||||
func TestEmptyQueryMatchesAnything(t *testing.T) {
|
||||
q := query.Empty{}
|
||||
assert.True(t, q.Matches(map[string]interface{}{}))
|
||||
assert.True(t, q.Matches(map[string]interface{}{"Asher": "Roth"}))
|
||||
assert.True(t, q.Matches(map[string]interface{}{"Route": 66}))
|
||||
assert.True(t, q.Matches(map[string]interface{}{"Route": 66, "Billy": "Blue"}))
|
||||
assert.True(t, q.Matches(pubsub.NewTagMap(map[string]interface{}{})))
|
||||
assert.True(t, q.Matches(pubsub.NewTagMap(map[string]interface{}{"Asher": "Roth"})))
|
||||
assert.True(t, q.Matches(pubsub.NewTagMap(map[string]interface{}{"Route": 66})))
|
||||
assert.True(t, q.Matches(pubsub.NewTagMap(map[string]interface{}{"Route": 66, "Billy": "Blue"})))
|
||||
}
|
||||
|
Reference in New Issue
Block a user