emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/emacsql 161e3a41b1 006/427: Add some tests.


From: ELPA Syncer
Subject: [nongnu] elpa/emacsql 161e3a41b1 006/427: Add some tests.
Date: Tue, 13 Dec 2022 02:59:23 -0500 (EST)

branch: elpa/emacsql
commit 161e3a41b1e5611bd3808c6658cfff821de4d346
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>

    Add some tests.
---
 emacsql-tests.el | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/emacsql-tests.el b/emacsql-tests.el
new file mode 100644
index 0000000000..31a3921c5c
--- /dev/null
+++ b/emacsql-tests.el
@@ -0,0 +1,17 @@
+(require 'ert)
+
+(ert-deftest emacsql-escape ()
+  (should (string= (emacsql-escape "foo") "foo"))
+  (should (string= (emacsql-escape 'foo) "foo"))
+  (should (string= (emacsql-escape :foo) "':foo'"))
+  (should (string= (emacsql-escape "a b") "'a b'"))
+  (should (string= (emacsql-escape '$foo) "'$foo'"))
+  (should (string= (emacsql-escape "foo$") "foo$"))
+  (should (string= (emacsql-escape "they're") "'they''re'")))
+
+(ert-deftest emacsql-escape-value ()
+  (should (string= (emacsql-escape-value 'foo) "foo"))
+  (should (string= (emacsql-escape-value "foo") "'\"foo\"'"))
+  (should (string= (emacsql-escape-value :foo) "':foo'"))
+  (should (string= (emacsql-escape-value [1 2 3]) "'[1 2 3]'"))
+  (should (string= (emacsql-escape-value '(a b c)) "'(a b c)'")))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]