add failing test for GH-12253
This commit is contained in:
parent
f9aa3d3a0b
commit
1e80c402bf
|
@ -876,6 +876,31 @@ func TestInterpolator_sets(t *testing.T) {
|
||||||
interfaceToVariableSwallowError(set))
|
interfaceToVariableSwallowError(set))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// When a splat reference is made to a resource that is unknown, we should
|
||||||
|
// return an error.
|
||||||
|
func TestInterpolater_resourceUnknownVariableList(t *testing.T) {
|
||||||
|
i := &Interpolater{
|
||||||
|
Module: testModule(t, "plan-computed-data-resource"),
|
||||||
|
State: NewState(), // state,
|
||||||
|
StateLock: new(sync.RWMutex),
|
||||||
|
}
|
||||||
|
|
||||||
|
scope := &InterpolationScope{
|
||||||
|
Path: rootModulePath,
|
||||||
|
}
|
||||||
|
|
||||||
|
// missing "data" from the reference here
|
||||||
|
v, err := config.NewInterpolatedVariable("aws_vpc.bar.*.foo")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("err: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = i.Values(scope, map[string]config.InterpolatedVariable{"foo": v})
|
||||||
|
if err == nil {
|
||||||
|
t.Fatal("expected error interpolating invalid resource")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func testInterpolate(
|
func testInterpolate(
|
||||||
t *testing.T, i *Interpolater,
|
t *testing.T, i *Interpolater,
|
||||||
scope *InterpolationScope,
|
scope *InterpolationScope,
|
||||||
|
|
Loading…
Reference in New Issue