# Copyright (c) 2001 D. Richard Hipp # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public # License along with this library; if not, write to the # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # # Author contact information: # drh@hwaci.com # http://www.hwaci.com/drh/ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the sqlite_exec_printf() and # sqlite_get_table_printf() APIs. # # $Id: tableapi.test,v 1.1 2001/04/07 15:24:34 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl do_test tableapi-1.0 { set ::dbx [sqlite_open testdb] catch {sqlite_exec_printf $::dbx {DROP TABLE xyz} {}} sqlite_exec_printf $::dbx {CREATE TABLE %s(a int, b text)} xyz } {0 {}} do_test tableapi-1.1 { sqlite_exec_printf $::dbx { INSERT INTO xyz VALUES(1,'%q') } {Hi Y'all} } {0 {}} do_test tableapi-1.2 { sqlite_exec_printf $::dbx {SELECT * FROM xyz} {} } {0 {a b 1 {Hi Y'all}}} do_test tableapi-2.1 { sqlite_get_table_printf $::dbx { SELECT * FROM xyz WHERE b='%q' } {Hi Y'all} } {0 1 2 a b 1 {Hi Y'all}} do_test tableapi-99.0 { sqlite_close $::dbx } {} finish_test