diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/bind.test | 14 | ||||
-rw-r--r-- | test/expr.test | 6 | ||||
-rw-r--r-- | test/interrupt.test | 12 | ||||
-rw-r--r-- | test/main.test | 8 |
4 files changed, 31 insertions, 9 deletions
diff --git a/test/bind.test b/test/bind.test index 85bebfbc3..361fff850 100644 --- a/test/bind.test +++ b/test/bind.test @@ -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 diff --git a/test/expr.test b/test/expr.test index 8bc66c432..94edb2c55 100644 --- a/test/expr.test +++ b/test/expr.test @@ -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 diff --git a/test/interrupt.test b/test/interrupt.test index e58fc7bb1..463347117 100644 --- a/test/interrupt.test +++ b/test/interrupt.test @@ -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 diff --git a/test/main.test b/test/main.test index 10ef35b2f..26f8381c8 100644 --- a/test/main.test +++ b/test/main.test @@ -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); |