mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Add testing for sqlite3_trace() and fix a bug. (CVS 1760)
FossilOrigin-Name: 7a15391079ae9ce5360fa13e8779c8872885e789
This commit is contained in:
46
test/trace.test
Normal file
46
test/trace.test
Normal file
@ -0,0 +1,46 @@
|
||||
# 2004 Jun 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.
|
||||
#
|
||||
#***********************************************************************
|
||||
# This file implements regression tests for SQLite library.
|
||||
#
|
||||
# This file implements tests for the "sqlite3_trace()" API.
|
||||
#
|
||||
# $Id: trace.test,v 1.1 2004/06/29 11:26:59 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
do_test trace-1.1 {
|
||||
set rc [catch {db trace 1 2 3} msg]
|
||||
lappend rc $msg
|
||||
} {1 {wrong # args: should be "db trace ?CALLBACK?"}}
|
||||
proc trace_proc cmd {
|
||||
lappend ::stmtlist [string trim $cmd]
|
||||
}
|
||||
do_test trace-1.2 {
|
||||
db trace trace_proc
|
||||
db trace
|
||||
} {trace_proc}
|
||||
do_test trace-1.3 {
|
||||
execsql {
|
||||
CREATE TABLE t1(a,b);
|
||||
INSERT INTO t1 VALUES(1,2);
|
||||
SELECT * FROM t1;
|
||||
}
|
||||
} {1 2}
|
||||
do_test trace-1.4 {
|
||||
set ::stmtlist
|
||||
} {{CREATE TABLE t1(a,b);} {INSERT INTO t1 VALUES(1,2);} {SELECT * FROM t1;} {}}
|
||||
do_test trace-1.5 {
|
||||
db trace {}
|
||||
db trace
|
||||
} {}
|
||||
|
||||
finish_test
|
Reference in New Issue
Block a user