MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / tokenize

Function tokenize

pkg/sql/tokenizer/tsql_test.go:36–47  ·  view source on GitHub ↗

tokenize is a test helper that tokenizes input and strips the trailing EOF.

(t *testing.T, tkz *Tokenizer, input string)

Source from the content-addressed store, hash-verified

34
35// tokenize is a test helper that tokenizes input and strips the trailing EOF.
36func tokenize(t *testing.T, tkz *Tokenizer, input string) []models.TokenWithSpan {
37 t.Helper()
38 tokens, err := tkz.Tokenize([]byte(input))
39 if err != nil {
40 t.Fatalf("Tokenize(%q) error = %v", input, err)
41 }
42 // Strip trailing EOF
43 if len(tokens) > 0 && tokens[len(tokens)-1].Token.Type == models.TokenTypeEOF {
44 tokens = tokens[:len(tokens)-1]
45 }
46 return tokens
47}
48
49func TestTSQL_TempTableIdentifiers(t *testing.T) {
50 tkz := newSQLServerTokenizer(t)

Calls 3

TokenizeMethod · 0.80
HelperMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected