OLD | NEW |
(Empty) | |
| 1 # 2009 October 23 |
| 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 to verify that ticket [3fe897352e8d8] has been |
| 14 # fixed. |
| 15 # |
| 16 |
| 17 set testdir [file dirname $argv0] |
| 18 source $testdir/tester.tcl |
| 19 |
| 20 # The following tests use hex_to_utf16be() and hex_to_utf16le() which |
| 21 # which are only available if SQLite is built with UTF16 support. |
| 22 ifcapable {!utf16} { |
| 23 finish_test |
| 24 return |
| 25 } |
| 26 |
| 27 do_test tkt-3fe89-1.1 { |
| 28 db close |
| 29 sqlite3 db :memory: |
| 30 db eval { |
| 31 PRAGMA encoding=UTF8; |
| 32 CREATE TABLE t1(x); |
| 33 INSERT INTO t1 VALUES(hex_to_utf16be('D800')); |
| 34 SELECT hex(x) FROM t1; |
| 35 } |
| 36 } {EDA080} |
| 37 do_test tkt-3fe89-1.2 { |
| 38 db eval { |
| 39 DELETE FROM t1; |
| 40 INSERT INTO t1 VALUES(hex_to_utf16le('00D8')); |
| 41 SELECT hex(x) FROM t1; |
| 42 } |
| 43 } {EDA080} |
| 44 do_test tkt-3fe89-1.3 { |
| 45 db eval { |
| 46 DELETE FROM t1; |
| 47 INSERT INTO t1 VALUES(hex_to_utf16be('DFFF')); |
| 48 SELECT hex(x) FROM t1; |
| 49 } |
| 50 } {EDBFBF} |
| 51 do_test tkt-3fe89-1.4 { |
| 52 db eval { |
| 53 DELETE FROM t1; |
| 54 INSERT INTO t1 VALUES(hex_to_utf16le('FFDF')); |
| 55 SELECT hex(x) FROM t1; |
| 56 } |
| 57 } {EDBFBF} |
| 58 |
| 59 |
| 60 finish_test |
OLD | NEW |