aboutsummaryrefslogtreecommitdiffstats
path: root/test/src/sqlite-tests.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen2022-10-10 14:09:54 +0200
committerLars Ingebrigtsen2022-10-10 14:10:04 +0200
commit8851a75ca7642ce071a23c24a81e22e443be0b05 (patch)
tree50c990f661ae090d0f839a3ad6939bc730ac4d6d /test/src/sqlite-tests.el
parente25bdd794629909020247ad6da13f9f0dab9a6e8 (diff)
downloademacs-8851a75ca7642ce071a23c24a81e22e443be0b05.tar.gz
emacs-8851a75ca7642ce071a23c24a81e22e443be0b05.zip
Add a test for sqlite "insert ... returning"
* test/src/sqlite-tests.el (sqlite-returning): Add a test for "insert ... returning".
Diffstat (limited to 'test/src/sqlite-tests.el')
-rw-r--r--test/src/sqlite-tests.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/src/sqlite-tests.el b/test/src/sqlite-tests.el
index 5af43923012..be4f60ab57f 100644
--- a/test/src/sqlite-tests.el
+++ b/test/src/sqlite-tests.el
@@ -241,4 +241,17 @@
241 (should (multibyte-string-p c1)) 241 (should (multibyte-string-p c1))
242 (should-not (multibyte-string-p c2))))))) 242 (should-not (multibyte-string-p c2)))))))
243 243
244(ert-deftest sqlite-returning ()
245 (skip-unless (sqlite-available-p))
246 (let (db)
247 (progn
248 (setq db (sqlite-open))
249 (sqlite-execute db "CREATE TABLE people1 (people_id INTEGER PRIMARY KEY, first TEXT, last TEXT)")
250 (should (null (sqlite-select db "select * from people1")))
251 (should
252 (equal
253 (sqlite-execute db "INSERT INTO people1 (first, last) values (?, ?) RETURNING people_id, first"
254 '("Joe" "Doe"))
255 '((1 "Joe")))))))
256
244;;; sqlite-tests.el ends here 257;;; sqlite-tests.el ends here