Package: lua-dbi / 0.7.2-2

test.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: Enrico Tassi <gareuselesinge@debian.org>
Date: Mon, 5 Mar 2018 14:27:10 +0100
Subject: test

===================================================================
---
 test.lua | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 test.lua

diff --git a/test.lua b/test.lua
new file mode 100644
index 0000000..70bced1
--- /dev/null
+++ b/test.lua
@@ -0,0 +1,12 @@
+local DBI = require('DBI')
+
+local h = assert(DBI.Connect(...))
+DBI.Do(h,'DROP TABLE foo')
+assert(DBI.Do(h,'CREATE TABLE foo (n int)'))
+assert(DBI.Do(h,'INSERT INTO foo VALUES (3)'))
+local s = h:prepare('SELECT * FROM foo where n > ?')
+assert(s:execute(3))
+assert(s:fetch() == nil)
+assert(s:execute(2))
+assert(#(s:fetch()) == 1)
+h:close()