Test CommentDef
(t *testing.T)
| 143 | |
| 144 | // Test CommentDef |
| 145 | func 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 |
| 176 | func TestOneOrManyWithParens(t *testing.T) { |
nothing calls this directly
no test coverage detected