aboutsummaryrefslogtreecommitdiff
path: root/test/test-util.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-01-01 22:25:00 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-01-01 22:25:00 -0200
commit6cc480fdab287133d6e09a9ad1eba260b891b604 (patch)
treef54e0334389bb0f017b75b3e91061994f2fc44e3 /test/test-util.el
parent026a6903e2bcc3a63da3db203b44516d9da3d9e4 (diff)
parente05f937910bb4ca0e7ea1c9f1273fbafac523921 (diff)
Merge branch 'master' into inbox
Conflicts: sx-question.el sx.el
Diffstat (limited to 'test/test-util.el')
-rw-r--r--test/test-util.el31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/test-util.el b/test/test-util.el
new file mode 100644
index 0000000..5db1691
--- /dev/null
+++ b/test/test-util.el
@@ -0,0 +1,31 @@
+(ert-deftest thing-as-string ()
+ "Test `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")))