about summary refs log tree commit diff
path: root/configs/shared
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2019-12-22T21·33+0000
committerWilliam Carroll <wpcarro@gmail.com>2019-12-24T15·21+0000
commitd1566dd0e64befd79e5db149456032dfb5a0c505 (patch)
treece6ce9ad87f52cea3d1a15c88493eec9e2de2714 /configs/shared
parent90955a3c021a070a2a09e9b260d9d4e670c9a304 (diff)
Refactor strings.el tests
Ensure that string.el follows the latest whim in my Elisp testing circus.
Diffstat (limited to 'configs/shared')
-rw-r--r--configs/shared/.emacs.d/wpc/string.el41
1 files changed, 18 insertions, 23 deletions
diff --git a/configs/shared/.emacs.d/wpc/string.el b/configs/shared/.emacs.d/wpc/string.el
index 56c9279dd5b9..9ffe84572af5 100644
--- a/configs/shared/.emacs.d/wpc/string.el
+++ b/configs/shared/.emacs.d/wpc/string.el
@@ -12,11 +12,16 @@
 
 (require 's)
 (require 'dash)
+;; TODO: Resolve the circular dependency that this introduces.
+;; (require 'prelude)
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Library
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+(defconst string/test? t
+  "When t, run the tests.")
+
 ;; Strings
 (defun string/hookify (x)
   "Append \"-hook\" to X."
@@ -98,29 +103,19 @@
 ;; Tests
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-;; TODO: Support these.
-;; (require 'macros)
-;; (macros/test
-;;  :function string/surround
-;;  :test "works as expected"
-;;  :args '("-*-" "surround")
-;;  :expect "-*-surround-*-"
-;;  :equality string=)
-;
-;; (macros/test
-;;  :function string/caps->kebab
-;;  :test "works as expected"
-;;  :args '("CAPS_CASE_STRING")
-;;  :expect "caps-case-string"
-;;  :equality string=)
-;
-;; ;; TODO: Generate :test from docs of defun.
-;; (macros/test
-;;  :function string/kebab->caps
-;;  :test "works as expected"
-;;  :args '("kebab-case-string")
-;;  :expect "KEBAB_CASE_STRING"
-;;  :equality =)
+;; (when string/test?
+;;   (prelude/assert
+;;    (string=
+;;     (string/surround "-*-" "surround")
+;;     "-*-surround-*-"))
+;;   (prelude/assert
+;;    (string=
+;;     (string/caps->kebab "CAPS_CASE_STRING")
+;;     "caps-case-string"))
+;;   (prelude/assert
+;;    (string=
+;;     (string/kebab->caps "kebab-case-string")
+;;     "KEBAB_CASE_STRING")))
 
 (provide 'string)
 ;;; string.el ends here