(t *testing.T)
| 85 | } |
| 86 | |
| 87 | func TestAttributesAbsoluteAttrError(t *testing.T) { |
| 88 | reg := newTestRegistry(t) |
| 89 | attrs := NewAttributeFactory(containers.DefaultContainer, reg, reg) |
| 90 | vars, err := NewActivation(map[string]any{ |
| 91 | "err": types.NewErr("invalid variable computation"), |
| 92 | }) |
| 93 | if err != nil { |
| 94 | t.Fatalf("NewActivation() failed: %v", err) |
| 95 | } |
| 96 | |
| 97 | // acme.a.b[4][false] |
| 98 | attr := attrs.AbsoluteAttribute(1, "err") |
| 99 | qualMsg := makeQualifier(t, attrs, nil, 2, "message") |
| 100 | attr.AddQualifier(qualMsg) |
| 101 | out, err := attr.Resolve(vars) |
| 102 | if err == nil { |
| 103 | t.Errorf("attr.Resolve('err') got %v, wanted error", out) |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | func TestAttributesRelativeAttr(t *testing.T) { |
| 108 | reg := newTestRegistry(t) |
nothing calls this directly
no test coverage detected