aboutsummaryrefslogtreecommitdiff
path: root/sam-test.el
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2020-07-24 21:28:07 +0200
committerOmar Polo <op@omarpolo.com>2020-07-24 21:28:07 +0200
commit054438e8f1f136e45bb843a16cee29d730ee5cd4 (patch)
tree5e088d0a4e75465bf877b43044113398b295b3ee /sam-test.el
downloadsam.el-054438e8f1f136e45bb843a16cee29d730ee5cd4.tar.gz
sam.el-054438e8f1f136e45bb843a16cee29d730ee5cd4.tar.bz2
initial commit
Diffstat (limited to 'sam-test.el')
-rw-r--r--sam-test.el20
1 files changed, 20 insertions, 0 deletions
diff --git a/sam-test.el b/sam-test.el
new file mode 100644
index 0000000..1c6fafb
--- /dev/null
+++ b/sam-test.el
@@ -0,0 +1,20 @@
+;;; sam-test.el --- sam test suite. -*- lexical-binding: t -*-
+
+(eval-when-compile
+ (require 'cl-lib))
+
+(require 'ert)
+(require 'sam)
+
+(ert-deftest sam-parse-command-test ()
+ (dolist (spec '(("3" "p" <- "3p")
+ ("3" "p" <- "3 p")
+ ("34" "p" <- "34\tp")
+ ("" "b" <- "b")
+ ("32" "" <- "32")))
+ (cl-destructuring-bind (exp-addr exp-cmd _ cmd) spec
+ (cl-destructuring-bind (address . command) (sam-parse-command cmd)
+ (should (string-equal exp-addr address))
+ (should (string-equal exp-cmd command))))))
+
+;; (ert-run-tests-interactively t)