OLD | NEW |
1 # 2015-05-11 | 1 # 2015-05-11 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
11 # | 11 # |
12 # Quick tests for the sqldiff tool | 12 # Quick tests for the sqldiff tool |
13 # | 13 # |
14 set testdir [file dirname $argv0] | 14 set testdir [file dirname $argv0] |
15 source $testdir/tester.tcl | 15 source $testdir/tester.tcl |
16 | 16 |
17 if {$tcl_platform(platform)=="windows"} { | 17 set PROG [test_find_sqldiff] |
18 set PROG "sqldiff.exe" | 18 |
19 } else { | |
20 set PROG "./sqldiff" | |
21 } | |
22 if {![file exe $PROG]} { | |
23 puts "sqldiff cannot run because $PROG is not available" | |
24 finish_test | |
25 return | |
26 } | |
27 db close | 19 db close |
28 forcedelete test.db test2.db | 20 forcedelete test.db test2.db |
29 sqlite3 db test.db | 21 sqlite3 db test.db |
30 | 22 |
31 do_test sqldiff-1.0 { | 23 do_test sqldiff-1.0 { |
32 db eval { | 24 db eval { |
33 CREATE TABLE t1(a INTEGER PRIMARY KEY, b); | 25 CREATE TABLE t1(a INTEGER PRIMARY KEY, b); |
34 CREATE TABLE t2(a INT PRIMARY KEY, b) WITHOUT ROWID; | 26 CREATE TABLE t2(a INT PRIMARY KEY, b) WITHOUT ROWID; |
35 WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<100) | 27 WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<100) |
36 INSERT INTO t1(a,b) SELECT x, printf('abc-%d-xyz',x) FROM c; | 28 INSERT INTO t1(a,b) SELECT x, printf('abc-%d-xyz',x) FROM c; |
(...skipping 19 matching lines...) Expand all Loading... |
56 set ::MSG | 48 set ::MSG |
57 } {DELETE FROM t1 WHERE a=49; | 49 } {DELETE FROM t1 WHERE a=49; |
58 INSERT INTO t1(a,b) VALUES(1234,'hello'); | 50 INSERT INTO t1(a,b) VALUES(1234,'hello'); |
59 DELETE FROM t2 WHERE a=48; | 51 DELETE FROM t2 WHERE a=48; |
60 INSERT INTO t2(a,b) VALUES(50.5,'xyzzy'); | 52 INSERT INTO t2(a,b) VALUES(50.5,'xyzzy'); |
61 CREATE TABLE t3(a,b,c); | 53 CREATE TABLE t3(a,b,c); |
62 INSERT INTO t3(rowid,a,b,c) VALUES(1,111,222,333); | 54 INSERT INTO t3(rowid,a,b,c) VALUES(1,111,222,333); |
63 DROP TABLE t4;} | 55 DROP TABLE t4;} |
64 | 56 |
65 finish_test | 57 finish_test |
OLD | NEW |