From ddb783f40720708b0e94e40caac30fdabaa41c64 Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Tue, 13 Jul 2021 13:06:46 +0800 Subject: [PATCH] add simple tsim test --- tests/examples/c/apitest.c | 6 +-- tests/script/general/parser/line_insert.sim | 42 ++++++++++++++++----- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/tests/examples/c/apitest.c b/tests/examples/c/apitest.c index b8f68636bd..f4e222c4dc 100644 --- a/tests/examples/c/apitest.c +++ b/tests/examples/c/apitest.c @@ -972,9 +972,9 @@ int32_t verify_schema_less(TAOS* taos) { "ste,t2=5,t3=L\"ste2\" c3=\"iamszhou\",c4=false 1626056811843316532" }; - //int code = taos_insert_by_lines(taos, lines , 5); - int code = taos_insert_by_lines(taos, &lines[0], 1); - code = taos_insert_by_lines(taos, &lines[1], 1); + int code = taos_insert_by_lines(taos, lines , 5); + //int code = taos_insert_by_lines(taos, &lines[0], 1); + //code = taos_insert_by_lines(taos, &lines[1], 1); return code; } diff --git a/tests/script/general/parser/line_insert.sim b/tests/script/general/parser/line_insert.sim index cb6d228e4d..f3067a3bbe 100644 --- a/tests/script/general/parser/line_insert.sim +++ b/tests/script/general/parser/line_insert.sim @@ -17,16 +17,38 @@ sql use $db sql create stable $mte (ts timestamp, f int) TAGS(t1 bigint) line_insert st,t1=3i,t2=4,t3="t3" c1=3i,c3=L"passit",c2=false,c4=4 1626006833639000000 -line_insert st,t1=4i,t3="t4",t2=5 c1=3i,c3=L"passitagain",c2=true,c4=5,c5=5 1626006833640000000 -line_insert st,t1=4i,t2=5,t3="t4" c1=3i,c3=L"passitagain",c2=true,c4=5 1626006833642000000 +line_insert st,t1=4i,t3="t41",t2=5 c1=3i,c3=L"passiT",c2=true,c4=5 1626006833640000000 +line_insert stf,t1=4i,t2=5,t3="t4" c1=3i,c3=L"passitagain",c2=true,c4=5 1626006833642000000 line_insert ste,t2=5,t3=L"ste" c1=true,c2=4,c3="iam" 1626056811823316532 -line_insert ste,t2=5,t3=L"ste2" c3="iamszhou",c4=false 1626056811843316532 + +sql select * from st +if $rows != 2 then + return -1 +endi + +if $data00 != @21-07-11 20:33:53.639000@ then + return -1 +endi + +if $data03 != @passit@ then + return -1 +endi + +sql select * from stf +if $rows != 1 then + return -1 +endi + +sql select * from ste +if $rows != 1 then + return -1 +endi #print =============== clear -#sql drop database $db -#sql show databases -#if $rows != 0 then -# return -1 -#endi -# -#system sh/exec.sh -n dnode1 -s stop -x SIGINT +sql drop database $db +sql show databases +if $rows != 0 then + return -1 +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT -- GitLab