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

Function TestDollarQuotedString_Nested

pkg/sql/tokenizer/dollar_quote_test.go:65–80  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

63}
64
65func TestDollarQuotedString_Nested(t *testing.T) {
66 tkz, _ := New()
67
68 input := `$$outer $inner$nested$inner$ outer$$`
69 tokens, err := tkz.Tokenize([]byte(input))
70 if err != nil {
71 t.Fatalf("unexpected error: %v", err)
72 }
73
74 if len(tokens) != 2 {
75 t.Fatalf("expected 2 tokens, got %d", len(tokens))
76 }
77 if tokens[0].Token.Value != "outer $inner$nested$inner$ outer" {
78 t.Errorf("expected nested content, got %q", tokens[0].Token.Value)
79 }
80}
81
82func TestDollarQuotedString_EmptyContent(t *testing.T) {
83 tkz, _ := New()

Callers

nothing calls this directly

Calls 4

TokenizeMethod · 0.80
NewFunction · 0.70
FatalfMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected