terraform: test for interpolation escapes
This commit is contained in:
parent
943b41b90f
commit
e7d59ab245
|
@ -47,6 +47,35 @@ func TestContext2Apply_basic(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestContext2Apply_escape(t *testing.T) {
|
||||
m := testModule(t, "apply-escape")
|
||||
p := testProvider("aws")
|
||||
p.ApplyFn = testApplyFn
|
||||
p.DiffFn = testDiffFn
|
||||
ctx := testContext2(t, &ContextOpts{
|
||||
Module: m,
|
||||
Providers: map[string]ResourceProviderFactory{
|
||||
"aws": testProviderFuncFixed(p),
|
||||
},
|
||||
})
|
||||
|
||||
if _, err := ctx.Plan(); err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
state, err := ctx.Apply()
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
checkStateString(t, state, `
|
||||
aws_instance.bar:
|
||||
ID = foo
|
||||
foo = "bar"
|
||||
type = aws_instance
|
||||
`)
|
||||
}
|
||||
|
||||
func TestContext2Apply_resourceCountOneList(t *testing.T) {
|
||||
m := testModule(t, "apply-resource-count-one-list")
|
||||
p := testProvider("null")
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
resource "aws_instance" "bar" {
|
||||
foo = "${"\"bar\""}"
|
||||
}
|
Loading…
Reference in New Issue