drh | b97759e | 2004-06-29 11:26:59 +0000 | [diff] [blame^] | 1 | # 2004 Jun 29 |
| 2 | # |
| 3 | # The author disclaims copyright to this source code. In place of |
| 4 | # 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 | # This file implements regression tests for SQLite library. |
| 12 | # |
| 13 | # This file implements tests for the "sqlite3_trace()" API. |
| 14 | # |
| 15 | # $Id: trace.test,v 1.1 2004/06/29 11:26:59 drh Exp $ |
| 16 | |
| 17 | set testdir [file dirname $argv0] |
| 18 | source $testdir/tester.tcl |
| 19 | |
| 20 | do_test trace-1.1 { |
| 21 | set rc [catch {db trace 1 2 3} msg] |
| 22 | lappend rc $msg |
| 23 | } {1 {wrong # args: should be "db trace ?CALLBACK?"}} |
| 24 | proc trace_proc cmd { |
| 25 | lappend ::stmtlist [string trim $cmd] |
| 26 | } |
| 27 | do_test trace-1.2 { |
| 28 | db trace trace_proc |
| 29 | db trace |
| 30 | } {trace_proc} |
| 31 | do_test trace-1.3 { |
| 32 | execsql { |
| 33 | CREATE TABLE t1(a,b); |
| 34 | INSERT INTO t1 VALUES(1,2); |
| 35 | SELECT * FROM t1; |
| 36 | } |
| 37 | } {1 2} |
| 38 | do_test trace-1.4 { |
| 39 | set ::stmtlist |
| 40 | } {{CREATE TABLE t1(a,b);} {INSERT INTO t1 VALUES(1,2);} {SELECT * FROM t1;} {}} |
| 41 | do_test trace-1.5 { |
| 42 | db trace {} |
| 43 | db trace |
| 44 | } {} |
| 45 | |
| 46 | finish_test |