2 #pragma ident "%Z%%M% %I% %E% SMI"
6 # The author disclaims copyright to this source code. In place of
7 # a legal notice, here is a blessing:
9 # May you do good and not evil.
10 # May you find forgiveness for yourself and forgive others.
11 # May you share freely, never taking more than you give.
13 #***********************************************************************
14 # This file implements regression tests for TCL interface to the
17 # The focus of the tests in this file is the following interface:
21 # $Id: hook.test,v 1.3 2004/01/15 02:44:03 drh Exp $
23 set testdir [file dirname $argv0]
24 source $testdir/tester.tcl
37 db commit_hook ::commit_hook
51 INSERT INTO t2 VALUES(1,2);
52 INSERT INTO t2 SELECT a+1, b+1 FROM t2;
53 INSERT INTO t2 SELECT a+2, b+2 FROM t2;
60 set ::commit_cnt [execsql {SELECT * FROM t2}]
64 INSERT INTO t2 VALUES(5,6);
67 } {1 2 2 3 3 4 4 5 5 6}
71 set ::commit_cnt [execsql {SELECT * FROM t2}]
75 INSERT INTO t2 VALUES(6,7);
77 } {1 {constraint failed}}
80 } {1 2 2 3 3 4 4 5 5 6 6 7}
82 execsql {SELECT * FROM t2}
83 } {1 2 2 3 3 4 4 5 5 6}