You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
580 B

  1. package query_test
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/assert"
  5. "github.com/tendermint/tendermint/libs/pubsub"
  6. "github.com/tendermint/tendermint/libs/pubsub/query"
  7. )
  8. func TestEmptyQueryMatchesAnything(t *testing.T) {
  9. q := query.Empty{}
  10. assert.True(t, q.Matches(pubsub.NewTagMap(map[string]string{})))
  11. assert.True(t, q.Matches(pubsub.NewTagMap(map[string]string{"Asher": "Roth"})))
  12. assert.True(t, q.Matches(pubsub.NewTagMap(map[string]string{"Route": "66"})))
  13. assert.True(t, q.Matches(pubsub.NewTagMap(map[string]string{"Route": "66", "Billy": "Blue"})))
  14. }