tkt-3fe897352e.test 1.4 KB

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