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

Function TestCommentDef

pkg/sql/ast/types_test.go:145–173  ·  view source on GitHub ↗

Test CommentDef

(t *testing.T)

Source from the content-addressed store, hash-verified

143
144// Test CommentDef
145func TestCommentDef(t *testing.T) {
146 tests := []struct {
147 name string
148 comment *CommentDef
149 wantLiteral string
150 }{
151 {
152 name: "simple comment",
153 comment: &CommentDef{
154 Text: "This is a user table",
155 },
156 wantLiteral: "COMMENT",
157 },
158 }
159
160 for _, tt := range tests {
161 t.Run(tt.name, func(t *testing.T) {
162 // Test TokenLiteral
163 if got := tt.comment.TokenLiteral(); got != tt.wantLiteral {
164 t.Errorf("CommentDef.TokenLiteral() = %v, want %v", got, tt.wantLiteral)
165 }
166
167 // Test Children (should be nil)
168 if children := tt.comment.Children(); children != nil {
169 t.Errorf("CommentDef.Children() = %v, want nil", children)
170 }
171 })
172 }
173}
174
175// Test OneOrManyWithParens
176func TestOneOrManyWithParens(t *testing.T) {

Callers

nothing calls this directly

Calls 4

RunMethod · 0.80
TokenLiteralMethod · 0.65
ErrorfMethod · 0.65
ChildrenMethod · 0.65

Tested by

no test coverage detected