mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-26 00:41:27 -06:00
terraform: failing test case
This commit is contained in:
parent
7ab19c62e6
commit
54de9057ba
@ -104,6 +104,29 @@ func TestContext2Plan_emptyDiff(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestContext2Plan_escapedVar(t *testing.T) {
|
||||
m := testModule(t, "plan-escaped-var")
|
||||
p := testProvider("aws")
|
||||
p.DiffFn = testDiffFn
|
||||
ctx := testContext2(t, &ContextOpts{
|
||||
Module: m,
|
||||
Providers: map[string]ResourceProviderFactory{
|
||||
"aws": testProviderFuncFixed(p),
|
||||
},
|
||||
})
|
||||
|
||||
plan, err := ctx.Plan()
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
actual := strings.TrimSpace(plan.String())
|
||||
expected := strings.TrimSpace(testTerraformPlanEscapedVarStr)
|
||||
if actual != expected {
|
||||
t.Fatalf("bad:\n%s", actual)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContext2Plan_minimal(t *testing.T) {
|
||||
m := testModule(t, "plan-empty")
|
||||
p := testProvider("aws")
|
||||
|
@ -983,6 +983,18 @@ STATE:
|
||||
<no state>
|
||||
`
|
||||
|
||||
const testTerraformPlanEscapedVarStr = `
|
||||
DIFF:
|
||||
|
||||
CREATE: aws_instance.foo
|
||||
foo: "" => "bar-${baz}"
|
||||
type: "" => "aws_instance"
|
||||
|
||||
STATE:
|
||||
|
||||
<no state>
|
||||
`
|
||||
|
||||
const testTerraformPlanModulesStr = `
|
||||
DIFF:
|
||||
|
||||
|
3
terraform/test-fixtures/plan-escaped-var/main.tf
Normal file
3
terraform/test-fixtures/plan-escaped-var/main.tf
Normal file
@ -0,0 +1,3 @@
|
||||
resource "aws_instance" "foo" {
|
||||
foo = "bar-$${baz}"
|
||||
}
|
Loading…
Reference in New Issue
Block a user