System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation

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

Overview
Comment:Improve testing of the changes on this branch.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | pst-76cb35b58d
Files: files | file ages | folders
SHA1: 2d2cbf56030d8275b944374c453e5a64fc4fe853
User & Date: mistachkin 2024-05-13 17:29:34
Context
2024-05-24
19:15
Fix support for unnamed parameters using the ?NNN syntax. Pursuant to forum post 76cb35b58d. check-in: ded053d6c2 user: mistachkin tags: trunk
2024-05-13
17:29
Improve testing of the changes on this branch. Closed-Leaf check-in: 2d2cbf5603 user: mistachkin tags: pst-76cb35b58d
2024-05-12
15:48
Update version history docs. check-in: 5003348e58 user: mistachkin tags: pst-76cb35b58d
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Tests/pst-76cb35b58d.eagle.

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
###############################################################################

package require System.Data.SQLite.Test
runSQLiteTestPrologue

###############################################################################

runTest {test pst-76cb35b58d-1.1 {unnamed parameters "duplicates"} -setup {
  setupDb [set fileName pst-76cb35b58d-1.1.db]
} -body {
  sql execute $db {
    CREATE TABLE t1(x INTEGER, y TEXT, z TEXT, w TEXT);
    INSERT INTO t1 (x, y) VALUES(1, 'one');
    INSERT INTO t1 (x, y) VALUES(2, 'two');
    INSERT INTO t1 (x, y) VALUES(3, 'three');







|







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
###############################################################################

package require System.Data.SQLite.Test
runSQLiteTestPrologue

###############################################################################

runTest {test pst-76cb35b58d-1.1 {duplicate unnamed parameters} -setup {
  setupDb [set fileName pst-76cb35b58d-1.1.db]
} -body {
  sql execute $db {
    CREATE TABLE t1(x INTEGER, y TEXT, z TEXT, w TEXT);
    INSERT INTO t1 (x, y) VALUES(1, 'one');
    INSERT INTO t1 (x, y) VALUES(2, 'two');
    INSERT INTO t1 (x, y) VALUES(3, 'three');
52
53
54
55
56
57
58
59
60
61























































62
63
  cleanupDb $fileName

  unset -nocomplain param1 param2
  unset -nocomplain db fileName
} -constraints {eagle monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result {1 one 2 two 3 three 4 four 5 99 6 6 7 7 {something\
else}}}

###############################################################################
























































runSQLiteTestEpilogue
runTestEpilogue










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


52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
  cleanupDb $fileName

  unset -nocomplain param1 param2
  unset -nocomplain db fileName
} -constraints {eagle monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result {1 one 2 two 3 three 4 four 5 99 6 6 7 7 {something\
else}}}

###############################################################################

runTest {test pst-76cb35b58d-1.2 {duplicate unnamed parameters} -setup {
  setupDb [set fileName pst-76cb35b58d-1.2.db]
} -body {
  sql execute $db {
    CREATE TABLE t1(x INTEGER, y TEXT);
    INSERT INTO t1 (x, y) VALUES(1, '1');
    INSERT INTO t1 (x, y) VALUES(2, '2');
    INSERT INTO t1 (x, y) VALUES(3, '3');
    INSERT INTO t1 (x, y) VALUES(4, '4');
  }

  set sql(0) {
    SELECT x, y FROM t1 WHERE x = 1 OR y = 1 ORDER BY x;
  }

  set sql(1) {
    SELECT x, y FROM t1 WHERE x = ? OR y = ? ORDER BY x;
  }

  set sql(2) {
    SELECT x, y FROM t1 WHERE x = ?1 OR y = ?1 ORDER BY x;
  }

  set sql(3) {
    SELECT x, y FROM t1 WHERE x = ?1 OR y = ?2 ORDER BY x;
  }

  set sql(4) {
    SELECT x, y FROM t1 WHERE x = ?2 OR y = ?1 ORDER BY x;
  }

  set sql(5) {
    SELECT x, y FROM t1 WHERE x = ?2 OR y = ?2 ORDER BY x;
  }

  set result [list]
  set param1 [list arg1 Int64 3]
  set param2 [list arg2 Int64 4]

  foreach name [lsort -integer [array names sql]] {
    lappend result [sql execute -execute reader \
        -format list $db $sql($name) $param1 $param2]
  }

  set result
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain sql name result param1 param2
  unset -nocomplain db fileName
} -constraints {eagle monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result {{1 1} {3 3 4 4} {3 3} {3 3 4 4} {3 3 4 4} {4 4}}}

###############################################################################

runSQLiteTestEpilogue
runTestEpilogue