Skip to content

Commit e1a4937

Browse files
author
Antoine Verin
committed
add test case for multiple failing command
1 parent 2e843f4 commit e1a4937

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

postgresql/resource_postgresql_script_test.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,28 @@ func TestAccPostgresqlScript_fail(t *testing.T) {
155155
},
156156
})
157157
}
158+
159+
func TestAccPostgresqlScript_failMultiple(t *testing.T) {
160+
config := `
161+
resource "postgresql_script" "invalid" {
162+
commands = [
163+
"BEGIN",
164+
"SLC FROM nowhere;",
165+
"COMMIT"
166+
]
167+
tries = 2
168+
timeout = 2
169+
}
170+
`
171+
172+
resource.Test(t, resource.TestCase{
173+
PreCheck: func() { testAccPreCheck(t) },
174+
Providers: testAccProviders,
175+
Steps: []resource.TestStep{
176+
{
177+
Config: config,
178+
ExpectError: regexp.MustCompile("syntax error"),
179+
},
180+
},
181+
})
182+
}

0 commit comments

Comments
 (0)