Add tests.

This commit is contained in:
Nikolai Kochetov 2022-02-01 18:57:56 +00:00
parent 0cac4b4a6e
commit ed90a0fc1c
4 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,7 @@
1
2
3
1
1
1
\n# hello 1

View File

@ -0,0 +1,16 @@
# comment
#! comment2
select 1;
# comment3
#! comment4
select 2; # another one comemnt
#
#!
select 3;
select 1; #!
SELECT # hello
1;
SELECT /* # hello */ 1;
SELECT '
# hello', 1;

View File

@ -0,0 +1,5 @@
OK
OK
OK
OK
OK

View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CUR_DIR"/../shell_config.sh
${CLICKHOUSE_CLIENT} --query="#" 2>&1 | grep -F -q 'Syntax error' && echo 'OK' || echo 'FAIL'
${CLICKHOUSE_CLIENT} --query="#not a comemnt" 2>&1 | grep -F -q 'Syntax error' && echo 'OK' || echo 'FAIL'
${CLICKHOUSE_CLIENT} --query="select 1 #not a comemnt" 2>&1 | grep -F -q 'Syntax error' && echo 'OK' || echo 'FAIL'
${CLICKHOUSE_CLIENT} --query="select 1 #" 2>&1 | grep -F -q 'Syntax error' && echo 'OK' || echo 'FAIL'
${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}" -d "select 42 #" 2>&1 | grep -F -q 'Syntax error' && echo 'OK' || echo 'FAIL'