commit 3a183a31639eb22bd204a29ceec85042fe49c248 parent 9c78349c9f59697511bc23b2448a0b3266c2d4e1 Author: Iqbal Ansari <iqbalansari02@yahoo.com> Date: Sun, 22 Nov 2015 21:24:16 +0530 Add some more tests 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 @@ -33,6 +33,23 @@ (should (equal (get-text-property (point) 'emojify-end) (point-max))) (should (equal (get-text-property (point) 'emojify-text) ":smile:")))) +(ert-deftest emojify-tests-simple-unicode-emoji-test () + :tags '(unicode simple) + (emojify-tests-with-emojified-static-buffer "😉" + (emojify-tests-should-be-emojified (point-min)) + (should (equal (get-text-property (point) 'emojify-buffer) (current-buffer))) + (should (equal (get-text-property (point-min) 'emojify-start) (point-min))) + (should (equal (get-text-property (point) 'emojify-end) (point-max))) + (should (equal (get-text-property (point) 'emojify-text) "😉")))) + +(ert-deftest emojify-tests-mixed-emoji-test () + :tags '(core mixed) + (emojify-tests-with-emojified-static-buffer "😉\n:D\nD:\n:smile:" + (emojify-tests-should-be-emojified (point-min)) + (emojify-tests-should-be-emojified (line-beginning-position 2)) + (emojify-tests-should-not-be-emojified (line-beginning-position 3)) + (emojify-tests-should-be-emojified (line-beginning-position 4)))) + (ert-deftest emojify-tests-emojifying-on-comment-uncomment () :tags '(core after-change) (emojify-tests-with-emojified-buffer ":smile:\n:)" @@ -375,6 +392,12 @@ (execute-kbd-macro [backspace])) (should (equal (point-min) (point-max)))) + (emojify-tests-with-emojified-buffer "😉 :smile:" + (goto-char (1+ (point-min))) + (dotimes (_ 3) + (execute-kbd-macro (kbd "C-d"))) + (should (equal (1+ (point-min)) (point-max)))) + (emojify-tests-with-emojified-buffer "😉:wink: ;)" "Integration with delsel mode" (with-mock