fix(wpcarro/emacs): Use should macro in maybe.el tests

More fixes along the way

Change-Id: I6b62eb0545981c2792d6c70089fe81324ba2dbf0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6010
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
This commit is contained in:
William Carroll 2022-07-30 07:16:08 -07:00 committed by clbot
parent 4193f24e5d
commit 6686c6d693

View file

@ -9,20 +9,17 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(ert-deftest maybe-nil? ()
(and
(maybe-nil? nil)
(not (maybe-nil? t))))
(should (maybe-nil? nil))
(should (not (maybe-nil? t))))
(ert-deftest maybe-some? ()
(and
(maybe-some? '(1 2 3))
(not (maybe-some? nil))))
(should (maybe-some? '(1 2 3)))
(should (not (maybe-some? nil))))
(ert-deftest maybe-default ()
(and
(string= "some" (maybe-default "some" nil))
(= 10 (maybe-default 1 10))))
(should (string= "some" (maybe-default "some" nil)))
(should (= 10 (maybe-default 1 10))))
(ert-deftest maybe-map ()
(eq nil (maybe-map (lambda (x) (* x 2)) nil))
(= 4 (maybe-map (lambda (x) (* x 2)) 2)))
(should (eq nil (maybe-map (lambda (x) (* x 2)) nil)))
(should (= 4 (maybe-map (lambda (x) (* x 2)) 2))))