Skip to content

Commit

Permalink
test(evil): fix evil tests by updating api
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuco1 committed Apr 10, 2024
1 parent 2fc9456 commit 1c6e471
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/smartparens-evil-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
(evil-mode)
(sp-kill-sexp 1 t)
(evil-mode -1)
(should (equal (buffer-string) (evil-get-register ?0)))))
(should (equal (buffer-string) (evil-get-register ?0 'no-error)))))

(ert-deftest sp-test-evil-disabled-copy-sexp ()
"When `evil-mode' is disabled, copying sexp doesn't modify 0 register."
(sp-test-with-temp-elisp-buffer "|(a b c)"
(evil-set-register ?0 nil)
(evil-mode -1)
(sp-kill-sexp 1 t)
(should (not (equal (buffer-string) (evil-get-register ?0))))))
(should (not (equal (buffer-string) (evil-get-register ?0 'no-error))))))

(ert-deftest sp-test-evil-enabled-copy-sexp-with-register ()
"When `evil-mode' is enabled, copying a sexp with register set will
Expand All @@ -25,7 +25,7 @@ copy the sexp into that register."
(setq evil-this-register ?a)
(sp-kill-sexp 1 t)
(evil-mode -1)
(should (equal (buffer-string) (evil-get-register ?a)))))
(should (equal (buffer-string) (evil-get-register ?a 'no-error)))))

(ert-deftest sp-test-evil-disabled-copy-sexp-with-register ()
"When `evil-mode' is disabled, copying a sexp with register set will not
Expand All @@ -34,7 +34,7 @@ copy the sexp into that register."
(evil-mode -1)
(setq evil-this-register ?c)
(sp-kill-sexp 1 t)
(should (not (equal (buffer-string) (evil-get-register ?c))))))
(should (not (equal (buffer-string) (evil-get-register ?c 'no-error))))))

(ert-deftest sp-test-evil-enabled-kill-sexp-with-register ()
"When `evil-mode' is enabled, killing a sexp with register set will
Expand All @@ -44,7 +44,7 @@ copy the sexp into that register."
(setq evil-this-register ?b)
(sp-kill-sexp 1 nil)
(evil-mode -1)
(should (equal "(a b c)" (evil-get-register ?b)))))
(should (equal "(a b c)" (evil-get-register ?b 'no-error)))))

(ert-deftest sp-test-evil-disabled-kill-sexp-with-register ()
"When `evil-mode' is disabled, killing a sexp with register set will not
Expand All @@ -53,4 +53,4 @@ copy the sexp into that register."
(evil-mode -1)
(setq evil-this-register ?d)
(sp-kill-sexp 1 nil)
(should (not (equal "(a b c)" (evil-get-register ?d))))))
(should (not (equal "(a b c)" (evil-get-register ?d 'no-error))))))

0 comments on commit 1c6e471

Please sign in to comment.