(t *testing.T)
| 544 | } |
| 545 | |
| 546 | func TestBodySetAttributeTraversal(t *testing.T) { |
| 547 | tests := []struct { |
| 548 | src string |
| 549 | name string |
| 550 | trav string |
| 551 | want Tokens |
| 552 | }{ |
| 553 | { |
| 554 | "", |
| 555 | "a", |
| 556 | `b`, |
| 557 | Tokens{ |
| 558 | { |
| 559 | Type: hclsyntax.TokenIdent, |
| 560 | Bytes: []byte{'a'}, |
| 561 | SpacesBefore: 0, |
| 562 | }, |
| 563 | { |
| 564 | Type: hclsyntax.TokenEqual, |
| 565 | Bytes: []byte{'='}, |
| 566 | SpacesBefore: 1, |
| 567 | }, |
| 568 | { |
| 569 | Type: hclsyntax.TokenIdent, |
| 570 | Bytes: []byte("b"), |
| 571 | SpacesBefore: 1, |
| 572 | }, |
| 573 | { |
| 574 | Type: hclsyntax.TokenNewline, |
| 575 | Bytes: []byte{'\n'}, |
| 576 | SpacesBefore: 0, |
| 577 | }, |
| 578 | { |
| 579 | Type: hclsyntax.TokenEOF, |
| 580 | Bytes: []byte{}, |
| 581 | SpacesBefore: 0, |
| 582 | }, |
| 583 | }, |
| 584 | }, |
| 585 | { |
| 586 | "", |
| 587 | "a", |
| 588 | `b.c.d`, |
| 589 | Tokens{ |
| 590 | { |
| 591 | Type: hclsyntax.TokenIdent, |
| 592 | Bytes: []byte{'a'}, |
| 593 | SpacesBefore: 0, |
| 594 | }, |
| 595 | { |
| 596 | Type: hclsyntax.TokenEqual, |
| 597 | Bytes: []byte{'='}, |
| 598 | SpacesBefore: 1, |
| 599 | }, |
| 600 | { |
| 601 | Type: hclsyntax.TokenIdent, |
| 602 | Bytes: []byte("b"), |
| 603 | SpacesBefore: 1, |
nothing calls this directly
no test coverage detected