MCPcopy Create free account
hub / github.com/araddon/qlbridge / TestToken

Function TestToken

lex/token_test.go:9–21  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestToken(t *testing.T) {
10 l := NewSqlLexer("SELECT X FROM Y;")
11 tok := l.NextToken()
12 err := tok.Err(l)
13 assert.NotEqual(t, "", err.Error())
14 err = tok.ErrMsg(l, "not now")
15 assert.NotEqual(t, "", err.Error())
16
17 tok = TokenFromOp("select")
18 assert.Equal(t, TokenSelect, tok.T)
19 tok = TokenFromOp("noway")
20 assert.Equal(t, TokenNil, tok.T)
21}

Callers

nothing calls this directly

Calls 7

NewSqlLexerFunction · 0.85
TokenFromOpFunction · 0.85
NextTokenMethod · 0.80
ErrMethod · 0.65
ErrMsgMethod · 0.65
EqualMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected