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

Function TestTSQL_NWithoutQuoteIsIdentifier

pkg/sql/tokenizer/tsql_test.go:207–218  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

205}
206
207func TestTSQL_NWithoutQuoteIsIdentifier(t *testing.T) {
208 // N not followed by quote should be a regular identifier
209 tkz := newSQLServerTokenizer(t)
210 tokens := tokenize(t, tkz, "N")
211 if len(tokens) != 1 {
212 t.Fatalf("expected 1 token, got %d", len(tokens))
213 }
214 // N should be an identifier (not a keyword in the map)
215 if tokens[0].Token.Type != models.TokenTypeIdentifier {
216 t.Errorf("expected TokenTypeIdentifier for bare N, got %v", tokens[0].Token.Type)
217 }
218}
219
220func TestTSQL_NStringNotInPostgreSQL(t *testing.T) {
221 // In PostgreSQL dialect, N'hello' should be IDENTIFIER + STRING (two tokens)

Callers

nothing calls this directly

Calls 4

newSQLServerTokenizerFunction · 0.85
tokenizeFunction · 0.85
FatalfMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected