1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Test coverage improvements on tokenize.c. (CVS 2196)

FossilOrigin-Name: 5767850ccadb3b53d14bca547e50f65de1d3092e
This commit is contained in:
drh
2005-01-11 17:46:41 +00:00
parent c5cdca613a
commit 48e5aa2769
6 changed files with 41 additions and 19 deletions

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this script testing the sqlite_bind API.
#
# $Id: bind.test,v 1.24 2005/01/11 16:54:15 drh Exp $
# $Id: bind.test,v 1.25 2005/01/11 17:46:42 drh Exp $
#
set testdir [file dirname $argv0]
@ -104,12 +104,13 @@ ifcapable {tclvar} {
execsql {
DELETE FROM t1;
}
set VM [sqlite3_prepare $DB {INSERT INTO t1 VALUES($one,$::two,${x})} -1 TX]
set VM [sqlite3_prepare $DB {INSERT INTO t1 VALUES($one,$::two,${x{y}z})}\
-1 TX]
set TX
} {}
set v1 {$one}
set v2 {$::two}
set v3 {${x}}
set v3 {${x{y}z}}
}
ifcapable {!tclvar} {
do_test bind-2.1 {
@ -491,4 +492,11 @@ do_test bind-10.16 {
} :pqr
catch {sqlite3_finalize $VM}
# Make sure we catch an unterminated "(" in a Tcl-style variable name
#
do_test bind-11.1 {
catchsql {SELECT * FROM sqlite_master WHERE name=$abc(123 and sql NOT NULL;}
} {1 {unrecognized token: "$abc(123"}}
finish_test

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing expressions.
#
# $Id: expr.test,v 1.40 2004/11/17 16:41:29 danielk1977 Exp $
# $Id: expr.test,v 1.41 2005/01/11 17:46:42 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -543,4 +543,8 @@ ifcapable datetime {
}
set sqlite_current_time 0
do_test expr-9.1 {
execsql {SELECT round(-('-'||'123'))}
} 123
finish_test

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this script is the sqlite_interrupt() API.
#
# $Id: interrupt.test,v 1.9 2005/01/11 16:54:15 drh Exp $
# $Id: interrupt.test,v 1.10 2005/01/11 17:46:42 drh Exp $
set testdir [file dirname $argv0]
@ -176,4 +176,14 @@ for {set i 1} {$i<$max_count-5} {incr i 1} {
} {1 interrupted}
}
# Interrupt during parsing
#
do_test interrupt-5.1 {
proc fake_interrupt {args} {sqlite3_interrupt $::DB; return SQLITE_OK}
db collation_needed fake_interrupt
catchsql {
CREATE INDEX fake ON fake1(a COLLATE fake_collation, b, c DESC);
}
} {1 interrupt}
finish_test

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is exercising the code in main.c.
#
# $Id: main.test,v 1.18 2004/11/04 04:42:28 drh Exp $
# $Id: main.test,v 1.19 2005/01/11 17:46:42 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -68,7 +68,7 @@ do_test main-1.14 {
db complete {SELECT a-b FROM t1; }
} {1}
do_test main-1.15 {
db complete {SELECT a-b FROM t1 }
db complete {SELECT a/e FROM t1 }
} {0}
do_test main-1.16 {
db complete {
@ -179,7 +179,7 @@ ifcapable {trigger} {
}
do_test main-1.28 {
db complete {
CREATE TEMP TRIGGER xyz AFTER DELETE backend BEGIN
CREATE TEMPORARY TRIGGER xyz AFTER DELETE backend BEGIN
UPDATE pqr SET a=5;
}
} {0}
@ -277,7 +277,7 @@ do_test main-3.3 {
file delete -force testdb
sqlite3 db testdb
execsql {
create table T1(X REAL);
create table T1(X REAL); /* C-style comments allowed */
insert into T1 values(0.5);
insert into T1 values(0.5e2);
insert into T1 values(0.5e-002);