SQLite

Check-in [f4cbd18db4]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add and enhance the new tests.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | altShellFix
Files: files | file ages | folders
SHA1: f4cbd18db47af4af990d7891dcc831e92b3f17e0
User & Date: mistachkin 2016-04-04 15:47:46.571
Context
2016-04-04
17:34
Improved handling of UTF8 by the command-line shell. (check-in: 4534ebf15f user: drh tags: trunk)
15:47
Add and enhance the new tests. (Closed-Leaf check-in: f4cbd18db4 user: mistachkin tags: altShellFix)
02:33
Refinements to the previous check-in. (check-in: b36dfdff78 user: mistachkin tags: altShellFix)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/shell1.test.
906
907
908
909
910
911
912
913
914
915



916

917
918
919
920
921
922
923
924
925
926
927
928
929
930
931















932
    }
    if {$res ne "$oldChar\n"} {
      error "failed with byte $hex mismatch"
    }
  }
} {}

do_test shell1-6.0 {
  # The base file name here is the word "test" in Chinese.
  # In UTF-8, it is encoded as: \xE6\xB5\x8B\xE8\xAF\x95



  set fileName \u6D4B\u8BD5; append fileName .db

  set x [catchcmdex $fileName "CREATE TABLE t1(x);\n.schema\n"]
  set code [lindex $x 0]
  set res [string trim [lindex $x 1]]
  if {$code ne "0"} {
    error "failed with error: $res"
  }
  if {$res ne "CREATE TABLE t1(x);"} {
    error "failed with mismatch: $res"
  }
  if {![file exists $fileName]} {
    error "file \"$fileName\" (Unicode) does not exist"
  }
  forcedelete $fileName
} {}
















finish_test







<
|
|
>
>
>
|
>















>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

906
907
908
909
910
911
912

913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
    }
    if {$res ne "$oldChar\n"} {
      error "failed with byte $hex mismatch"
    }
  }
} {}


# The string used here is the word "test" in Chinese.
# In UTF-8, it is encoded as: \xE6\xB5\x8B\xE8\xAF\x95
set test \u6D4B\u8BD5

do_test shell1-6.0 {
  set fileName $test; append fileName .db
  catch {forcedelete $fileName}
  set x [catchcmdex $fileName "CREATE TABLE t1(x);\n.schema\n"]
  set code [lindex $x 0]
  set res [string trim [lindex $x 1]]
  if {$code ne "0"} {
    error "failed with error: $res"
  }
  if {$res ne "CREATE TABLE t1(x);"} {
    error "failed with mismatch: $res"
  }
  if {![file exists $fileName]} {
    error "file \"$fileName\" (Unicode) does not exist"
  }
  forcedelete $fileName
} {}

do_test shell1-6.1 {
  catch {forcedelete test3.db}
  set x [catchcmdex test3.db \
      "CREATE TABLE [encoding convertto utf-8 $test](x);\n.schema\n"]
  set code [lindex $x 0]
  set res [string trim [lindex $x 1]]
  if {$code ne "0"} {
    error "failed with error: $res"
  }
  if {$res ne "CREATE TABLE ${test}(x);"} {
    error "failed with mismatch: $res"
  }
  forcedelete test3.db
} {}

finish_test