aboutsummaryrefslogtreecommitdiff
path: root/test/test-util.el
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2015-01-01 19:03:34 -0500
committerSean Allred <code@seanallred.com>2015-01-01 19:03:34 -0500
commit01ac19db7ff5087e3c2b481a57d21d242ee9fb34 (patch)
tree76bff5cb0fc075542ad4f8b135b770591993c2d2 /test/test-util.el
parent9650a1541b43da18067466df7671d23d5baffeed (diff)
parentbf4f193a76100917764f249023f4844a2ca15b2c (diff)
Merge pull request #185 from vermiculus/ert-refactor
Refactor tests
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")))