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

Function TestTSQL_NStringNotInPostgreSQL

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

Source from the content-addressed store, hash-verified

218}
219
220func TestTSQL_NStringNotInPostgreSQL(t *testing.T) {
221 // In PostgreSQL dialect, N'hello' should be IDENTIFIER + STRING (two tokens)
222 tkz, err := NewWithDialect(keywords.DialectPostgreSQL)
223 if err != nil {
224 t.Fatalf("NewWithDialect error = %v", err)
225 }
226 tokens := tokenize(t, tkz, "N'hello'")
227 if len(tokens) != 2 {
228 t.Fatalf("expected 2 tokens for PostgreSQL N'hello', got %d", len(tokens))
229 }
230 if tokens[0].Token.Type != models.TokenTypeIdentifier {
231 t.Errorf("expected first token to be identifier, got %v", tokens[0].Token.Type)
232 }
233}
234
235func TestTSQL_BracketIdentifierUnterminatedStructuredError(t *testing.T) {
236 tkz := newSQLServerTokenizer(t)

Callers

nothing calls this directly

Calls 4

NewWithDialectFunction · 0.85
tokenizeFunction · 0.85
FatalfMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected