emacs-emojify

fork of https://github.com/iqbalansari/emacs-emojify
Log | Files | Refs | LICENSE

commit 136ed6c5abff6955780dadb0ac5413e40186c82a
parent 24f19fa6007a982eb384ee5c922c685f4cd090f2
Author: Iqbal Ansari <iqbalansari02@yahoo.com>
Date:   Sun, 22 Nov 2015 21:02:35 +0530

Some more tests for electric delete functionality

Diffstat:
Mtest/emojify-test.el | 26+++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/test/emojify-test.el b/test/emojify-test.el @@ -362,7 +362,31 @@ (let ((final-line-end (get-text-property (1- (point)) 'emojify-start))) (execute-kbd-macro [backspace]) (emojify-tests-should-not-be-emojified (line-end-position)) - (should (equal (line-end-position) final-line-end))))) + (should (equal (line-end-position) final-line-end)))) + + (emojify-tests-with-emojified-buffer "😉:wink: ;)" + (dotimes (_ 4) + (execute-kbd-macro (kbd "C-d"))) + (should (equal (point-min) (point-max)))) + + (emojify-tests-with-emojified-buffer "😉:wink: ;)" + (goto-char (point-max)) + (dotimes (_ 4) + (execute-kbd-macro [backspace])) + (should (equal (point-min) (point-max)))) + + (emojify-tests-with-emojified-buffer "😉:wink: ;)" + "Integration with delsel mode" + (with-mock + (stub message => nil) + (delete-selection-mode +1) + (set-mark-command nil) + (activate-mark) + (goto-char (point-max)) + (exchange-point-and-mark) + (let ((this-command 'emojify-delete-emoji-forward)) + (delete-selection-pre-hook)) + (should (equal (point-min) (point-max)))))) ;; So that tests can be run simply by doing `eval-buffer' (unless noninteractive