Team Ai
Modelpublic

AryaWu/sqlite

sourceHugging Faceupdated 10mo agoView on Hugging Face
0likes
func9.test67 linesDownload Raw Back to test
1# 2023-08-292#3# The author disclaims copyright to this source code.  In place of4# a legal notice, here is a blessing:5#6#    May you do good and not evil.7#    May you find forgiveness for yourself and forgive others.8#    May you share freely, never taking more than you give.9#10#*************************************************************************11#12# Test cases for some newer SQL functions13#14set testdir [file dirname $argv0]15source $testdir/tester.tcl16 17do_execsql_test func9-100 {18  SELECT concat('abc',123,null,'xyz');19} {abc123xyz}20do_execsql_test func9-110 {21  SELECT typeof(concat(null));22} {text}23do_catchsql_test func9-120 {24  SELECT concat();25} {1 {wrong number of arguments to function concat()}}26do_execsql_test func9-130 {27  SELECT concat_ws(',',1,2,3,4,5,6,7,8,NULL,9,10,11,12);28} {1,2,3,4,5,6,7,8,9,10,11,12}29do_execsql_test func9-131 {30  SELECT concat_ws(',',1,2,3,4,'',6,7,8,NULL,9,10,11,12);31} {1,2,3,4,,6,7,8,9,10,11,12}32do_execsql_test func9-132 {33  SELECT concat_ws(',','',2,3,4,'',6,7,8,NULL,9,10,11,12);34} {,2,3,4,,6,7,8,9,10,11,12}35do_execsql_test func9-133 {36  SELECT concat_ws(',',NULL,'',3,4,'',6,7,8,NULL,9,10,11,12);37} {,3,4,,6,7,8,9,10,11,12}38do_execsql_test func9-134 {39  SELECT concat_ws(',',NULL,NULL,NULL,'',3,4,'',6,7,8,NULL,9,10,11,12);40} {,3,4,,6,7,8,9,10,11,12}41do_execsql_test func9-140 {42  SELECT concat_ws(NULL,1,2,3,4,5,6,7,8,NULL,9,10,11,12);43} {{}}44do_catchsql_test func9-150 {45  SELECT concat_ws();46} {1 {wrong number of arguments to function concat_ws()}}47do_catchsql_test func9-160 {48  SELECT concat_ws(',');49} {1 {wrong number of arguments to function concat_ws()}}50 51# https://sqlite.org/forum/forumpost/4c344ca61f (2025-03-02)52do_execsql_test func9-200 {53  SELECT unistr('G\u00e4ste');54} {Gäste}55do_execsql_test func9-210 {56  SELECT unistr_quote(unistr('G\u00e4ste'));57} {'Gäste'}58do_execsql_test func9-220 {59  SELECT format('%#Q',unistr('G\u00e4ste'));60} {'Gäste'}61 62do_execsql_test func9-300 {63  SELECT hex( unistr('\UFFFFFFFF') )64} {F7BFBFBF}65 66finish_test67