(t *testing.T)
| 282 | } |
| 283 | |
| 284 | func TestList(t *testing.T) { |
| 285 | fac := ast.NewExprFactory() |
| 286 | expr := fac.NewList(20, []ast.Expr{fac.NewLiteral(21, types.OptionalOf(types.True))}, []int32{0}) |
| 287 | list := expr.AsList() |
| 288 | if list.Size() != 1 { |
| 289 | t.Errorf("list.Size() got %s, wanted 'a'", expr.AsIdent()) |
| 290 | } |
| 291 | if list.Elements()[0].Kind() != ast.LiteralKind { |
| 292 | t.Errorf("list.Elements()[0] got %v, wanted true", list.Elements()[0]) |
| 293 | } |
| 294 | if list.OptionalIndices()[0] != 0 { |
| 295 | t.Errorf("list.OptionalIndices()[0] got %d, wanted 0", list.OptionalIndices()[0]) |
| 296 | } |
| 297 | expr.RenumberIDs(testIDGen(50)) |
| 298 | if expr.ID() != 51 { |
| 299 | t.Errorf("expr.ID() got %d, wanted 51", expr.ID()) |
| 300 | } |
| 301 | if list.Elements()[0].ID() != 52 { |
| 302 | t.Errorf("list.Elements()[0].ID() got %d, wanted 52", list.Elements()[0].ID()) |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | func TestListNil(t *testing.T) { |
| 307 | expr := nilTestExpr(t) |
nothing calls this directly
no test coverage detected