xref: /sqlite-3.40.0/test/enc3.test (revision 4dcbdbff)
1# 2002 May 24
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# The focus of this file is testing of the proper handling of conversions
14# to the native text representation.
15#
16# $Id: enc3.test,v 1.4 2004/11/14 21:56:31 drh Exp $
17
18set testdir [file dirname $argv0]
19source $testdir/tester.tcl
20
21ifcapable {utf16} {
22  do_test enc3-1.1 {
23    execsql {
24      PRAGMA encoding=utf16le;
25      PRAGMA encoding;
26    }
27  } {UTF-16le}
28}
29do_test enc3-1.2 {
30  execsql {
31    CREATE TABLE t1(x,y);
32    INSERT INTO t1 VALUES('abc''123',5);
33    SELECT * FROM t1
34  }
35} {abc'123 5}
36do_test enc3-1.3 {
37  execsql {
38    SELECT quote(x) || ' ' || quote(y) FROM t1
39  }
40} {{'abc''123' 5}}
41ifcapable {bloblit} {
42  do_test enc3-1.4 {
43    execsql {
44      DELETE FROM t1;
45      INSERT INTO t1 VALUES(x'616263646566',NULL);
46      SELECT * FROM t1
47    }
48  } {abcdef {}}
49  do_test enc3-1.5 {
50    execsql {
51      SELECT quote(x) || ' ' || quote(y) FROM t1
52    }
53  } {{X'616263646566' NULL}}
54}
55
56
57finish_test
58