emacs-emojify

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

commit e5bbdbbc61501ca99adb7d0579a7389e8f45af7f
parent 6ef5a146cf8ca8732e7ca5e06607593a6a616d93
Author: Iqbal Ansari <iqbalansari02@yahoo.com>
Date:   Sun, 18 Sep 2016 15:02:26 +0530

Add tests for org-bullets mode integration

Diffstat:
MCask | 4+++-
Mtest/emojify-test.el | 20++++++++++++++++++++
Mtest/test-helper.el | 3++-
3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/Cask b/Cask @@ -9,4 +9,6 @@ (depends-on "ecukes") (depends-on "ert-runner") (depends-on "el-mock") - (depends-on "noflet")) + (depends-on "noflet") + ;; Needed for testing emojification of composed text + (depends-on "org-bullets")) diff --git a/test/emojify-test.el b/test/emojify-test.el @@ -609,6 +609,26 @@ return 4 (emojify-tests-should-not-be-emojified (line-beginning-position 6)) (emojify-tests-should-be-emojified (line-beginning-position 7)))))) +(ert-deftest emojify-tests-org-bullets () + :tags '(org-bullets) + (emojify-tests-with-emojified-buffer "* A +** B +*** C +" + (let ((org-bullets-bullet-list '("🍣" "🐸" "🐳")) + (emojify-composed-text-p t)) + (org-mode) + (require 'org-bullets) + (org-bullets-mode) + (emojify-redisplay) + (emojify-tests-should-not-be-emojified (point-min)) + (emojify-tests-should-not-be-emojified (1+ (line-beginning-position 2))) + (emojify-tests-should-not-be-emojified (+ 2 (line-beginning-position 3))) + (emojify-redisplay) + (emojify-tests-should-be-emojified (point-min)) + (emojify-tests-should-be-emojified (1+ (line-beginning-position 2))) + (emojify-tests-should-be-emojified (+ 2 (line-beginning-position 3)))))) + (ert-deftest emojify-tests-apropos () :tags '(apropos) (emojify-apropos-emoji "squi") diff --git a/test/test-helper.el b/test/test-helper.el @@ -164,7 +164,8 @@ All kinds of dynamic behaviour on buffer are disabled. See (defun emojify-redisplay () "Trigger a redisplay." - (jit-lock-fontify-now)) + (jit-lock-fontify-now (point-min) (point-max)) + (emojify-redisplay-emojis-in-region (point-min) (point-max))) (provide 'test-helper) ;;; test-helper.el ends here