From 568b0b308f57106e86512a1c7e75c1e581a5ab55 Mon Sep 17 00:00:00 2001 From: Colin Dellow Date: Thu, 5 Jul 2018 20:48:04 -0400 Subject: [PATCH] test: bad create table --- tests/test-all | 1 + tests/test-bad-create-table | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100755 tests/test-bad-create-table diff --git a/tests/test-all b/tests/test-all index 306d46e..e702164 100755 --- a/tests/test-all +++ b/tests/test-all @@ -5,6 +5,7 @@ here=$(dirname "${BASH_SOURCE[0]}") set -x "$here"/test-non-existent +"$here"/test-bad-create-table "$here"/test-unsupported "$here"/test-supported "$here"/test-queries diff --git a/tests/test-bad-create-table b/tests/test-bad-create-table new file mode 100755 index 0000000..9f3e5e5 --- /dev/null +++ b/tests/test-bad-create-table @@ -0,0 +1,31 @@ +#!/bin/bash +set -euo pipefail + +# Verify that all the unsupported.*parquet files result in an error when creating the virtual table, +# but don't segfault. + +load_bad_table() { + cat < /dev/null 2> testcase-stderr.txt + # We expect the 'SELECT 123' command to NOT have been run + if grep -q 123 testcase-out.txt; then + echo "...FAILED; expected an error message. Check testcase-{out,err}.txt" >&2 + exit 1 + fi +} + +main "$@"