(t *testing.T)
| 459 | } |
| 460 | |
| 461 | func TestStructFieldNil(t *testing.T) { |
| 462 | fac := ast.NewExprFactory() |
| 463 | entry := fac.NewMapEntry(1, |
| 464 | fac.NewLiteral(2, types.String("hello")), |
| 465 | fac.NewLiteral(3, types.String("world")), |
| 466 | false) |
| 467 | |
| 468 | // intentionally convert the map entry to the wrong type |
| 469 | field := entry.AsStructField() |
| 470 | if field.Name() != "" { |
| 471 | t.Errorf("field.FieldName() got %s, wanted ''", field.Name()) |
| 472 | } |
| 473 | if field.Value().Kind() != ast.UnspecifiedExprKind { |
| 474 | t.Errorf("field.Value() got %v, wanted unspecified", field.Value()) |
| 475 | } |
| 476 | if field.IsOptional() { |
| 477 | t.Errorf("field.IsOptional() got %v, wanted ''", field.IsOptional()) |
| 478 | } |
| 479 | } |
| 480 | |
| 481 | func TestRenumberIDs(t *testing.T) { |
| 482 | fac := ast.NewExprFactory() |
nothing calls this directly
no test coverage detected