aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2014-12-02 00:07:16 -0500
committerSean Allred <code@seanallred.com>2014-12-02 00:07:16 -0500
commit114ca09da984738df2510bc72753a3443d16857c (patch)
tree384e7784c661ca07ce187370290014ed1b98aa20
parent07ead3d320ebe2d14c89f47a715571f9b124187d (diff)
Add tests for `sx--thing-as-string'
-rw-r--r--test/tests.el32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/tests.el b/test/tests.el
index 75238fe..43531b4 100644
--- a/test/tests.el
+++ b/test/tests.el
@@ -133,3 +133,35 @@
(macroexpand
'(sx-assoc-let data
(cons .test-one .test-two))))))
+
+(ert-deftest thing-as-string ()
+ "Tests `sx--thing-as-string'"
+ (should
+ (string= (sx--thing-as-string
+ '(hello world (this is a test))
+ '(";" "+"))
+ "hello;world;this+is+a+test"))
+ (should
+ (string= (sx--thing-as-string
+ '(this is a test) '(";" "+"))
+ "this;is;a;test"))
+ (should
+ (string= (sx--thing-as-string
+ '(this is a test) "+")
+ "this+is+a+test"))
+ (should
+ (string= (sx--thing-as-string
+ '(this is a test))
+ "this;is;a;test"))
+ (should
+ (string= (sx--thing-as-string
+ 'test)
+ "test"))
+ (should
+ (string= (sx--thing-as-string
+ 'test&)
+ "test&"))
+ (should
+ (string= (sx--thing-as-string
+ 'test& nil t)
+ "test%26")))