emacs-emojify

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

commit 0d88ce1de7514ab7e9784ab89978e39fa7ed2786
parent cd14485c5b1121938ac294057e48a594ec230b39
Author: Iqbal Ansari <iqbalansari02@yahoo.com>
Date:   Sun, 18 Sep 2016 12:28:47 +0530

Update tests to work with general handing of composition text

Diffstat:
Mtest/emojify-test.el | 36+++++++++++++++++-------------------
Mtest/test-helper.el | 1+
2 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/test/emojify-test.el b/test/emojify-test.el @@ -171,46 +171,42 @@ (setq prettify-symbols-alist '(("return" . ?↪))) + (setq emojify-composed-text-p t) + (when (fboundp 'prettify-symbols-mode) (prettify-symbols-mode +1)) (emojify-set-emoji-styles '(ascii)) (emojify-tests-should-be-emojified ascii-emoji-pos) (emojify-tests-should-not-be-emojified unicode-emoji-pos) - (emojify-tests-should-not-be-emojified github-emoji-pos) (emojify-tests-should-not-be-emojified prettify-emoji-pos) + (emojify-tests-should-not-be-emojified github-emoji-pos) (emojify-set-emoji-styles '(unicode)) (emojify-tests-should-not-be-emojified ascii-emoji-pos) (emojify-tests-should-be-emojified unicode-emoji-pos) + (when (fboundp 'prettify-symbols-mode) + (emojify-tests-should-be-emojified prettify-emoji-pos)) (emojify-tests-should-not-be-emojified github-emoji-pos) - (emojify-tests-should-not-be-emojified prettify-emoji-pos) (emojify-set-emoji-styles '(github)) (emojify-tests-should-not-be-emojified ascii-emoji-pos) (emojify-tests-should-not-be-emojified unicode-emoji-pos) - (emojify-tests-should-be-emojified github-emoji-pos) (emojify-tests-should-not-be-emojified prettify-emoji-pos) + (emojify-tests-should-be-emojified github-emoji-pos) - (emojify-set-emoji-styles '(prettify-symbol)) - (emojify-tests-should-not-be-emojified ascii-emoji-pos) - (emojify-tests-should-not-be-emojified unicode-emoji-pos) - (emojify-tests-should-not-be-emojified github-emoji-pos) - (when (fboundp 'prettify-symbols-mode) - (emojify-tests-should-be-emojified prettify-emoji-pos)) - - (emojify-set-emoji-styles '(ascii unicode github prettify-symbol)) + (emojify-set-emoji-styles '(ascii unicode github)) (emojify-tests-should-be-emojified ascii-emoji-pos) (emojify-tests-should-be-emojified unicode-emoji-pos) - (emojify-tests-should-be-emojified github-emoji-pos) (when (fboundp 'prettify-symbols-mode) (emojify-tests-should-be-emojified prettify-emoji-pos)) + (emojify-tests-should-be-emojified github-emoji-pos) (emojify-set-emoji-styles nil) (emojify-tests-should-not-be-emojified ascii-emoji-pos) (emojify-tests-should-not-be-emojified unicode-emoji-pos) - (emojify-tests-should-not-be-emojified github-emoji-pos) - (emojify-tests-should-not-be-emojified prettify-emoji-pos)))) + (emojify-tests-should-not-be-emojified prettify-emoji-pos) + (emojify-tests-should-not-be-emojified github-emoji-pos)))) (ert-deftest emojify-tests-program-contexts () :tags '(core prog contextual) @@ -546,7 +542,8 @@ lambdalambda yield 3 return 4 " - (emojify-set-emoji-styles '(ascii unicode github prettify-symbol)) + (setq emojify-composed-text-p t) + (emojify-set-emoji-styles '(ascii unicode github)) (python-mode) (setq prettify-symbols-alist '(("return" . ?↪) @@ -562,15 +559,15 @@ return 4 (emojify-tests-should-not-be-emojified (line-beginning-position 8)) (prettify-symbols-mode +1) (emojify-tests-should-be-emojified (point-min)) - (should (equal (get-text-property (point-min) 'emojify-text) "try")) + (should (equal (get-text-property (point-min) 'emojify-text) "😱")) (emojify-tests-should-not-be-emojified (line-beginning-position 3)) (emojify-tests-should-be-emojified (+ (line-beginning-position 4) 5)) - (should (equal (get-text-property (+ (line-beginning-position 4) 5) 'emojify-text) "raise")) + (should (equal (get-text-property (+ (line-beginning-position 4) 5) 'emojify-text) "💥")) (emojify-tests-should-not-be-emojified (line-beginning-position 5)) (emojify-tests-should-not-be-emojified (line-beginning-position 6)) (emojify-tests-should-not-be-emojified (line-beginning-position 7)) (emojify-tests-should-be-emojified (line-beginning-position 8)) - (should (equal (get-text-property (line-beginning-position 8) 'emojify-text) "return")) + (should (equal (get-text-property (line-beginning-position 8) 'emojify-text) "↪")) (prettify-symbols-mode -1) (emojify-tests-should-not-be-emojified (point-min)) (emojify-tests-should-not-be-emojified (line-beginning-position 3)) @@ -593,7 +590,8 @@ except: yield 3 return 4 " - (emojify-set-emoji-styles '(ascii unicode github prettify-symbol)) + (setq emojify-composed-text-p t) + (emojify-set-emoji-styles '(ascii unicode github)) (python-mode) (setq prettify-symbols-alist '(("return" . ?↪) diff --git a/test/test-helper.el b/test/test-helper.el @@ -62,6 +62,7 @@ Helps isolate tests from each other's customizations." (unless (file-exists-p (emojify-image-dir)) (emojify-download-emoji emojify-emoji-set)) (emojify-debug-mode +1) + (setq emojify-composed-text-p nil) ,@forms) (setq emojify-emoji-json emojify-saved-emoji-json emojify-display-style emojify-saved-display-style