added cache test
This commit is contained in:
parent
83cd654030
commit
a1a335a53c
2 changed files with 22 additions and 2 deletions
19
cache_test.go
Normal file
19
cache_test.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package filter
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestNewQueryCache(t *testing.T) {
|
||||
c := NewQueryCache(1)
|
||||
_, err := c.NewQuery("Int:1")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
q2, err := c.NewQuery("Int:2")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
q3 := c.Lookup("Int:2")
|
||||
if q2.String() != q3.String() {
|
||||
t.Error("q2 != q3")
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue