commit 3a4fa6e91df43e816c27fe4671f10c51c1110d3c parent abbe63d5f60de1fe82a04de080044da35ee37b8a Author: Iqbal Ansari <iqbalansari02@yahoo.com> Date: Mon, 2 Nov 2015 09:07:21 +0530 Add tests for isearch-mode integration Diffstat:
M | emojify-tests.el | | | 15 | +++++++++++++++ |
1 file changed, 15 insertions(+), 0 deletions(-)
diff --git a/emojify-tests.el b/emojify-tests.el @@ -319,6 +319,21 @@ Helps isolate tests from each other's customizations." (emojify-tests-should-not-be-emojified (1- (line-end-position))) (emojify-tests-should-be-emojified (line-beginning-position 2)))) +(ert-deftest emojify-tests-uncover-on-isearch () + (emojify-tests-with-emojified-buffer "Testing isearch\n:books:" + (with-mock + ;; We do not want to be bothered with isearch messages + (stub message => nil) + (emojify-tests-should-be-emojified (line-beginning-position 2)) + (isearch-mode +1) + (execute-kbd-macro ":book") + ;; Emoji should be uncovered when point enters it in isearch-mode + (emojify-tests-should-be-uncovered (line-beginning-position)) + (isearch-exit) + ;; Emoji should be restored on leaving the underlying text + (goto-char (point-min)) + (emojify-tests-should-be-emojified (line-beginning-position 2))))) + ;; So that tests can be run simply by doing `eval-buffer' (unless noninteractive (ert "^emojify-"))