Test OneOrManyWithParens
(t *testing.T)
| 174 | |
| 175 | // Test OneOrManyWithParens |
| 176 | func TestOneOrManyWithParens(t *testing.T) { |
| 177 | tests := []struct { |
| 178 | name string |
| 179 | parens *OneOrManyWithParens[*Ident] |
| 180 | wantLiteral string |
| 181 | wantChildren int |
| 182 | }{ |
| 183 | { |
| 184 | name: "multiple identifiers", |
| 185 | parens: &OneOrManyWithParens[*Ident]{ |
| 186 | Items: []*Ident{ |
| 187 | {Name: "id"}, |
| 188 | {Name: "name"}, |
| 189 | {Name: "email"}, |
| 190 | }, |
| 191 | }, |
| 192 | wantLiteral: "(", |
| 193 | wantChildren: 3, |
| 194 | }, |
| 195 | } |
| 196 | |
| 197 | for _, tt := range tests { |
| 198 | t.Run(tt.name, func(t *testing.T) { |
| 199 | // Test TokenLiteral |
| 200 | if got := tt.parens.TokenLiteral(); got != tt.wantLiteral { |
| 201 | t.Errorf("OneOrManyWithParens.TokenLiteral() = %v, want %v", got, tt.wantLiteral) |
| 202 | } |
| 203 | |
| 204 | // Test Children |
| 205 | children := tt.parens.Children() |
| 206 | if len(children) != tt.wantChildren { |
| 207 | t.Errorf("OneOrManyWithParens.Children() count = %d, want %d", len(children), tt.wantChildren) |
| 208 | } |
| 209 | }) |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | // Test WrappedCollection |
| 214 | func TestWrappedCollection(t *testing.T) { |
nothing calls this directly
no test coverage detected