feat(wpcarro/emacs): Package string.el

Mostly just a wrapper around s.el (for now?). Eventually I'd like to prune the
dependency on dash.el (and maybe s.el).

Change-Id: I5c2ba256524bedd93fcd13933fdbd95b1ddff6f8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6002
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
This commit is contained in:
William Carroll 2022-07-29 18:56:06 -07:00 committed by clbot
parent 7410928b5b
commit 8989dad5ed
4 changed files with 57 additions and 19 deletions

View file

@ -0,0 +1,22 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Dependencies
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'ert)
(require 'string)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Tests
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(ert-deftest string-caps->kebab ()
(string= "foo-bar-baz" (string-caps->kebab "FOO_BAR_BAZ")))
(ert-deftest string-kebab->caps ()
(string= "FOO_BAR_BAZ" (string-kebab->caps "foo-bar-baz")))
(ert-deftest string-lower->caps ()
(string= "FOO_BAR_BAZ" (string-lower->caps "foo bar baz")))
(ert-deftest string-lower->kebab ()
(string= "foo-bar-baz" (string-lower->kebab "foo bar baz")))