(t *testing.T)
| 1673 | } |
| 1674 | |
| 1675 | func TestAttribute_StringRepresentation(t *testing.T) { |
| 1676 | reg := newTestRegistry(t) |
| 1677 | cont := containers.DefaultContainer |
| 1678 | fac := NewAttributeFactory(cont, reg, reg) |
| 1679 | |
| 1680 | ident := fac.AbsoluteAttribute(1, "a") |
| 1681 | abs := fac.AbsoluteAttribute(2, "a.b", "b") |
| 1682 | maybe := fac.MaybeAttribute(3, "c") |
| 1683 | rel := fac.RelativeAttribute(4, NewConstValue(1, types.String("d"))) |
| 1684 | cond := fac.ConditionalAttribute(5, NewConstValue(1, types.True), abs, maybe) |
| 1685 | trail := types.NewAttributeTrail("x") |
| 1686 | |
| 1687 | tests := []struct { |
| 1688 | name string |
| 1689 | stringer fmt.Stringer |
| 1690 | }{ |
| 1691 | {name: "identAttribute", stringer: ident.(fmt.Stringer)}, |
| 1692 | {name: "absoluteAttribute", stringer: abs.(fmt.Stringer)}, |
| 1693 | {name: "maybeAttribute", stringer: maybe.(fmt.Stringer)}, |
| 1694 | {name: "relativeAttribute", stringer: rel.(fmt.Stringer)}, |
| 1695 | {name: "conditionalAttribute", stringer: cond.(fmt.Stringer)}, |
| 1696 | {name: "AttributeTrail", stringer: trail}, |
| 1697 | } |
| 1698 | for _, tc := range tests { |
| 1699 | t.Run(tc.name, func(t *testing.T) { |
| 1700 | if str := tc.stringer.String(); str == "" { |
| 1701 | t.Errorf("%s.String() returned empty string", tc.name) |
| 1702 | } |
| 1703 | }) |
| 1704 | } |
| 1705 | } |
| 1706 | |
| 1707 | func TestIdentAttribute(t *testing.T) { |
| 1708 | reg := newTestRegistry(t) |
nothing calls this directly
no test coverage detected