aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-04-21 09:24:52 +0200
committerOmar Polo <op@omarpolo.com>2021-04-21 09:24:52 +0200
commitaa844fa44621a1cadd4ee2324ced361d37a94952 (patch)
tree39186e426959feead731af855aefce97cc4fb177
parent8f580bff30f33ea63b1d9e5899cfe4cfea6fff4a (diff)
downloadsam.el-aa844fa44621a1cadd4ee2324ced361d37a94952.tar.gz
sam.el-aa844fa44621a1cadd4ee2324ced361d37a94952.tar.bz2
some tests for sam-parse-delimited
-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)