tokenize is a test helper that tokenizes input and strips the trailing EOF.
(t *testing.T, tkz *Tokenizer, input string)
| 34 | |
| 35 | // tokenize is a test helper that tokenizes input and strips the trailing EOF. |
| 36 | func 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 | |
| 49 | func TestTSQL_TempTableIdentifiers(t *testing.T) { |
| 50 | tkz := newSQLServerTokenizer(t) |
no test coverage detected