exec.test 978 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # 2008 Jan 21
  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_exec interface
  14. #
  15. # $Id: exec.test,v 1.1 2008/01/21 16:22:46 drh Exp $
  16. set testdir [file dirname $argv0]
  17. source $testdir/tester.tcl
  18. do_test exec-1.1 {
  19. execsql {
  20. CREATE TABLE t1(a,b);
  21. INSERT INTO t1 VALUES(1,2);
  22. SELECT * FROM t1;
  23. }
  24. } {1 2}
  25. do_test exec-1.2 {
  26. sqlite3_exec db {/* comment */;;; SELECT * FROM t1; /* comment */}
  27. } {0 {a b 1 2}}
  28. do_test exec-1.3 {
  29. sqlite3 db2 test.db
  30. db2 eval {CREATE TABLE t2(x, y);}
  31. db2 close
  32. sqlite3_exec db {SELECT * FROM t1}
  33. } {0 {a b 1 2}}
  34. finish_test