branch: elpa/smartparens commit 096a8f6a64a05baf0dd22c68ceeda23eb136aa50 Author: Matus Goljer <matus.gol...@gmail.com> Commit: Matus Goljer <matus.gol...@gmail.com>
test: add kill/delete related test cases --- test/smartparens-commands-test.el | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/smartparens-commands-test.el b/test/smartparens-commands-test.el index 04c8dedc6e..150db7a77b 100644 --- a/test/smartparens-commands-test.el +++ b/test/smartparens-commands-test.el @@ -1023,3 +1023,29 @@ This is the behavior of `paredit-convolute-sexp'." (sp-buffer-equals "(foo) (progn |(bar))")))) + +(ert-deftest sp-test-sp-delete-word-not-changing-kill-ring nil + "#1097" + (sp-test-with-temp-elisp-buffer "|hello world" + (setq kill-ring '("one" "two" "three" "four" "five")) + (sp-kill-word 1) + (sp-delete-word 1) + (yank) + (sp-buffer-equals "hello"))) + +(ert-deftest sp-test-sp-backward-delete-word-not-changing-kill-ring nil + "#1040" + (sp-test-with-temp-elisp-buffer "hello world one two three|" + (setq kill-ring '("one" "two" "three" "four" "five")) + (sp-backward-delete-word 1) + (sp-backward-delete-word 1) + (yank) + (sp-buffer-equals "hello world one one"))) + +(ert-deftest sp-test-sp-backward-delete-no-error-with-empty-kill-ring nil + "#1115" + (sp-test-with-temp-elisp-buffer "hello world one two three|" + (setq kill-ring nil) + (call-interactively 'sp-backward-delete-word) + (call-interactively 'sp-backward-delete-word) + (sp-buffer-equals "hello world one ")))