0
0
mirror of https://github.com/sqlite/sqlite.git synced 2024-11-24 16:18:08 +01:00
sqlite/test/func9.test
drh e1e67abc5c Add support for the CONCAT() and CONCAT_WS() SQL functions, modeled after
the PostgreSQL behavior.

FossilOrigin-Name: 0b434ca7aa19eff4ad134a8c6f88f6a7ccab88864faa55e93579a2462d8ac3bc
2023-08-29 15:24:41 +00:00

41 lines
1.1 KiB
Plaintext

# 2023-08-29
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#*************************************************************************
#
# Test cases for SQL newer functions
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
do_execsql_test func9-100 {
SELECT concat('abc',123,null,'xyz');
} {abc123xyz}
do_execsql_test func9-110 {
SELECT typeof(concat(null));
} {text}
do_catchsql_test func9-120 {
SELECT concat();
} {1 {wrong number of arguments to function concat()}}
do_execsql_test func9-130 {
SELECT concat_ws(',',1,2,3,4,5,6,7,8,NULL,9,10,11,12);
} {1,2,3,4,5,6,7,8,9,10,11,12}
do_execsql_test func9-140 {
SELECT concat_ws(NULL,1,2,3,4,5,6,7,8,NULL,9,10,11,12);
} {{}}
do_catchsql_test func9-150 {
SELECT concat_ws();
} {1 {wrong number of arguments to function concat_ws()}}
do_catchsql_test func9-160 {
SELECT concat_ws(',');
} {1 {wrong number of arguments to function concat_ws()}}
finish_test