Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions test/standard/check-test-install-error-stop-script.bats
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,22 @@ setup() {
assert_success
}

@test "check-test-install-error-stop.sh: passes when ON_ERROR_STOP is explicitly turned on then off" {
printf '\\set ON_ERROR_STOP on\nCREATE TABLE foo AS SELECT 1;\n\\set ON_ERROR_STOP off\n' > "$TESTDIR/install/foo.sql"

run "$SCRIPT" "$TESTDIR"
assert_success
}

@test "check-test-install-error-stop.sh: fails when ON_ERROR_STOP is only ever turned off" {
printf '\\set ON_ERROR_STOP off\nCREATE TABLE foo AS SELECT 1;\n' > "$TESTDIR/install/foo.sql"

run "$SCRIPT" "$TESTDIR"
assert_failure_with_status 1
assert_contains "$output" "foo.sql"
assert_contains "$output" "ON_ERROR_STOP"
}

@test "check-test-install-error-stop.sh: fails when a file has neither" {
printf 'CREATE TABLE foo AS SELECT 1;\n' > "$TESTDIR/install/foo.sql"

Expand Down