aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sam-test.el20
1 files changed, 20 insertions, 0 deletions
diff --git a/sam-test.el b/sam-test.el
index 8b7ee3a..cd23e99 100644
--- a/sam-test.el
+++ b/sam-test.el
@@ -1,5 +1,10 @@
;;; sam-test.el --- sam test suite. -*- lexical-binding: t -*-
+;;; Commentary:
+;; Sam.el test case.
+
+;;; Code:
+
(eval-when-compile
(require 'cl-lib))
@@ -25,6 +30,21 @@
(should (string-equal exp-cmd cmd))
(should (string-equal exp-fn fn))))))
+(ert-deftest sam-parse-delimited-test ()
+ (cl-flet ((parse-delimited (in exp)
+ (equal (sam-parse-delimited in)
+ exp)))
+ (cl-loop with spec = '(("/foo/bar" . ("foo" "bar"))
+ ("?foo?bar" . ("foo" "bar"))
+ (",foo," . ("foo" ""))
+ ("||" . ("" ""))
+ ("*foo*bar" . ("foo" "bar"))
+ (".foo.bar" . ("foo" "bar"))
+ ;(".foo...." . ("foo" "..."))
+ )
+ for (input . exp) in spec
+ do (should (parse-delimited input exp)))))
+
;; (ert-run-tests-interactively t)
(provide 'sam-test)