commit 2be283c6a9b1996ee2c4d023942dd6c335a52b12 parent 1be0c7a1f8474c00d1581183889ff255356911bc Author: Iqbal Ansari <iqbalansari02@yahoo.com> Date: Sun, 22 Nov 2015 18:12:51 +0530 Add initial tests for electric delete functionality Diffstat:
M | test/emojify-test.el | | | 23 | +++++++++++++++++++++++ |
1 file changed, 23 insertions(+), 0 deletions(-)
diff --git a/test/emojify-test.el b/test/emojify-test.el @@ -340,6 +340,29 @@ (emojify-tests-should-be-emojified first-emoji-pos) (emojify-tests-should-be-emojified second-emoji-pos))))) +(ert-deftest emojify-tests-electric-delete () + :tags '(electric-delete) + (emojify-tests-with-emojified-buffer "Unicode emoji 😉\nGithub emoji :wink:\nAscii emoji ;)" + (goto-char (line-end-position)) + (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)))) + + (emojify-tests-with-emojified-buffer "Unicode emoji 😉\nGithub emoji :wink:\nAscii emoji ;)" + (goto-char (line-end-position 2)) + (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)))) + + (emojify-tests-with-emojified-buffer "Unicode emoji 😉\nGithub emoji :wink:\nAscii emoji ;)" + (goto-char (line-end-position 3)) + (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))))) + ;; So that tests can be run simply by doing `eval-buffer' (unless noninteractive (ert "^emojify-"))