milvus/internal/parser/planparserv2/pool_test.go
cai.zhang ccd685013a
Json key must be enclosed in double quotes (#24113)
Signed-off-by: cai.zhang <cai.zhang@zilliz.com>
2023-05-16 16:19:22 +08:00

38 lines
878 B
Go

package planparserv2
import (
"testing"
"github.com/antlr/antlr4/runtime/Go/antlr"
antlrparser "github.com/milvus-io/milvus/internal/parser/planparserv2/generated"
"github.com/stretchr/testify/assert"
)
func genNaiveInputStream() *antlr.InputStream {
return antlr.NewInputStream("a > 2")
}
func Test_getLexer(t *testing.T) {
var lexer *antlrparser.PlanLexer
lexer = getLexer(genNaiveInputStream(), &errorListener{})
assert.NotNil(t, lexer)
lexer = getLexer(genNaiveInputStream(), &errorListener{})
assert.NotNil(t, lexer)
}
func Test_getParser(t *testing.T) {
var lexer *antlrparser.PlanLexer
var parser *antlrparser.PlanParser
lexer = getLexer(genNaiveInputStream(), &errorListener{})
assert.NotNil(t, lexer)
parser = getParser(lexer, &errorListener{})
assert.NotNil(t, parser)
parser = getParser(lexer, &errorListener{})
assert.NotNil(t, parser)
}