From e36d23a85ebff914d74bb541558c2b6082b78edb Mon Sep 17 00:00:00 2001 From: dan miller Date: Sat, 20 Oct 2007 02:49:29 +0000 Subject: sqlite source (unix build) added to libraries --- libraries/sqlite/unix/sqlite-3.5.1/test/enc3.test | 81 +++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 libraries/sqlite/unix/sqlite-3.5.1/test/enc3.test (limited to 'libraries/sqlite/unix/sqlite-3.5.1/test/enc3.test') diff --git a/libraries/sqlite/unix/sqlite-3.5.1/test/enc3.test b/libraries/sqlite/unix/sqlite-3.5.1/test/enc3.test new file mode 100644 index 0000000..64f5807 --- /dev/null +++ b/libraries/sqlite/unix/sqlite-3.5.1/test/enc3.test @@ -0,0 +1,81 @@ +# 2002 May 24 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# This file implements regression tests for SQLite library. +# +# The focus of this file is testing of the proper handling of conversions +# to the native text representation. +# +# $Id: enc3.test,v 1.6 2007/05/10 21:14:03 drh Exp $ + +set testdir [file dirname $argv0] +source $testdir/tester.tcl + +ifcapable {utf16} { + do_test enc3-1.1 { + execsql { + PRAGMA encoding=utf16le; + PRAGMA encoding; + } + } {UTF-16le} +} +do_test enc3-1.2 { + execsql { + CREATE TABLE t1(x,y); + INSERT INTO t1 VALUES('abc''123',5); + SELECT * FROM t1 + } +} {abc'123 5} +do_test enc3-1.3 { + execsql { + SELECT quote(x) || ' ' || quote(y) FROM t1 + } +} {{'abc''123' 5}} +ifcapable {bloblit} { + do_test enc3-1.4 { + execsql { + DELETE FROM t1; + INSERT INTO t1 VALUES(x'616263646566',NULL); + SELECT * FROM t1 + } + } {abcdef {}} + do_test enc3-1.5 { + execsql { + SELECT quote(x) || ' ' || quote(y) FROM t1 + } + } {{X'616263646566' NULL}} +} +ifcapable {bloblit && utf16} { + do_test enc3-2.1 { + execsql { + PRAGMA encoding + } + } {UTF-16le} + do_test enc3-2.2 { + execsql { + CREATE TABLE t2(a); + INSERT INTO t2 VALUES(x'61006200630064006500'); + SELECT CAST(a AS text) FROM t2 WHERE a LIKE 'abc%'; + } + } {abcde} + do_test enc3-2.3 { + execsql { + SELECT CAST(x'61006200630064006500' AS text); + } + } {abcde} + do_test enc3-2.4 { + execsql { + SELECT rowid FROM t2 WHERE a LIKE x'610062002500'; + } + } {1} +} + + +finish_test -- cgit v1.1