Skip to content

Commit 2e63a69

Browse files
committed
config: validate good count variables
1 parent b484ec1 commit 2e63a69

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

config/config_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ func TestConfigValidate_countUserVar(t *testing.T) {
9595
}
9696
}
9797

98+
func TestConfigValidate_countVar(t *testing.T) {
99+
c := testConfig(t, "validate-count-var")
100+
if err := c.Validate(); err != nil {
101+
t.Fatal("err: %s", err)
102+
}
103+
}
104+
98105
func TestConfigValidate_countVarInvalid(t *testing.T) {
99106
c := testConfig(t, "validate-count-var-invalid")
100107
if err := c.Validate(); err == nil {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
resource "aws_instance" "foo" {
2+
foo = "${count.index}"
3+
}

0 commit comments

Comments
 (0)