System.Data.SQLite
Check-in [99befef947]
Not logged in

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

Overview
Comment:Add tests.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tkt-3567020edf
Files: files | file ages | folders
SHA1: 99befef947dc4db43d158b77f9ca7de78e41d187
User & Date: mistachkin 2013-03-06 22:37:20
Context
2013-03-06
23:05
Properly handle embedded NUL characters in parameter and column values. Fix for [3567020edf]. check-in: c77dd425d4 user: mistachkin tags: trunk
22:37
Add tests. Closed-Leaf check-in: 99befef947 user: mistachkin tags: tkt-3567020edf
22:14
Preliminary changes to fix ticket [3567020edf]. Missing tests. check-in: bea6b5d82d user: mistachkin tags: tkt-3567020edf
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Added Tests/tkt-3567020edf.eagle.

            1  +###############################################################################
            2  +#
            3  +# tkt-3567020edf.eagle --
            4  +#
            5  +# Written by Joe Mistachkin.
            6  +# Released to the public domain, use at your own risk!
            7  +#
            8  +###############################################################################
            9  +
           10  +package require Eagle
           11  +package require Eagle.Library
           12  +package require Eagle.Test
           13  +
           14  +runTestPrologue
           15  +
           16  +###############################################################################
           17  +
           18  +package require System.Data.SQLite.Test
           19  +runSQLiteTestPrologue
           20  +
           21  +###############################################################################
           22  +
           23  +runTest {test tkt-3567020edf-1.1 {embedded NUL characters (UTF-8)} -setup {
           24  +  setupDb [set fileName tkt-3567020edf-1.1.db]
           25  +} -body {
           26  +  sql execute $db "CREATE TABLE t1(x);"
           27  +
           28  +  sql execute $db "INSERT INTO t1 (x) VALUES(?);" \
           29  +      [list param1 String one\x00two]
           30  +
           31  +  sql execute -execute reader -format list $db "SELECT x FROM t1;"
           32  +} -cleanup {
           33  +  cleanupDb $fileName
           34  +
           35  +  unset -nocomplain db fileName
           36  +} -constraints \
           37  +{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
           38  +"one\x00two"}
           39  +
           40  +###############################################################################
           41  +
           42  +runTest {test tkt-3567020edf-1.2 {embedded NUL characters (UTF-16)} -setup {
           43  +  setupDb [set fileName tkt-3567020edf-1.2.db] "" "" "" "" \
           44  +      UseUTF16Encoding=True
           45  +} -body {
           46  +  sql execute $db "CREATE TABLE t1(x);"
           47  +
           48  +  sql execute $db "INSERT INTO t1 (x) VALUES(?);" \
           49  +      [list param1 String one\x00two]
           50  +
           51  +  sql execute -execute reader -format list $db "SELECT x FROM t1;"
           52  +} -cleanup {
           53  +  cleanupDb $fileName
           54  +
           55  +  unset -nocomplain db fileName
           56  +} -constraints \
           57  +{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
           58  +"one\x00two"}
           59  +
           60  +###############################################################################
           61  +
           62  +runSQLiteTestEpilogue
           63  +runTestEpilogue