Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
* lispy-test.el (lispy-ace-subword): Unite two tests with identical
name (caused to fail tests).
(lispy-outline-add): Update test to agree with current behaviour of
lispy-meta-return (since 6efe2b4).
(lispy-tilde): Rename second instance of lispy-outline-add to avoid
two identical test names.
(lispy--pretty-args): Agree with updated docstring of defun (since
Emacs 73e75e18).

ERT fails with redefined tests in batch mode:
    Error: error ("Test ‘lispy-ace-subword’ redefined")
  • Loading branch information
EugeneNeuron committed Mar 2, 2024
1 parent fe44efd commit 937b9ee
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions lispy-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -2172,10 +2172,6 @@ Insert KEY if there's no command."
(throw 'break nil))
(lispy-tab)))))

(ert-deftest lispy-ace-subword ()
(should (string= (lispy-with "|foo-bar-baz~" (lispy-ace-subword 1))
"~foo|-bar-baz")))

(ert-deftest lispy-flatten ()
(should (string= (lispy-with
"(defun square (x &optional y &rest z)\n (if y\n (cons 200 z)\n (* x x)))|\n(square 10 1 2 3)"
Expand Down Expand Up @@ -2386,9 +2382,9 @@ Insert KEY if there's no command."

(ert-deftest lispy-outline-add ()
(should (string= (lispy-with "|;;* Intro" "a")
";;* Intro\n;;* |")))
";;* Intro\n\n|;;* ")))

(ert-deftest lispy-outline-add ()
(ert-deftest lispy-tilde ()
(should (string= (lispy-with "(quote ~foo|)" "~")
"(quote ~~foo|)"))
(should (string= (lispy-with "(quote ~~foo|)" "~")
Expand Down Expand Up @@ -2595,6 +2591,8 @@ Insert KEY if there's no command."
"(progn (setq type 'norwegian-blue)\n (~setq| plumage-type 'lovely))"))))

(ert-deftest lispy-ace-subword ()
(should (string= (lispy-with "|foo-bar-baz~" (lispy-ace-subword 1))
"~foo|-bar-baz"))
(should (string= (lispy-with "|(progn (setq type 'norwegian-blue)\n (setq plumage-type 'lovely))"
(execute-kbd-macro (kbd "-g")))
"(progn (setq type 'norwegian-blue)\n (setq |plumage~-type 'lovely))"))
Expand Down Expand Up @@ -3245,13 +3243,14 @@ Insert KEY if there's no command."
9 29 (face lispy-face-req-nosel)
30 37 (face lispy-face-rst-nosel))))
(should (equal (lispy--pretty-args 'defun)
#("(defun name arglist docstring decl body...)"
#("(defun name arglist [docstring] [decl] [interactive] body...)"
1 6 (face lispy-face-hint)
7 11 (face lispy-face-req-nosel)
12 19 (face lispy-face-req-nosel)
20 29 (face lispy-face-opt-nosel)
30 34 (face lispy-face-opt-nosel)
35 42 (face lispy-face-rst-nosel))))
20 31 (face lispy-face-req-nosel)
32 38 (face lispy-face-req-nosel)
39 52 (face lispy-face-req-nosel)
53 60 (face lispy-face-rst-nosel))))
(should (equal (lispy--pretty-args 'defvar)
#("(defvar symbol initvalue docstring)"
1 7 (face lispy-face-hint)
Expand Down

0 comments on commit 937b9ee

Please # to comment.