commit 7d15554a946b0ce701b993285f2be4ef839e1e4f parent 7d00803afe2c2c7f7195ffc49cf9b4e7be3a863d Author: Iqbal Ansari <iqbal.ansari@ignitesol.com> Date: Mon, 2 Nov 2015 18:29:39 +0530 Add a failing test for multiple isearch matches Diffstat:
M | emojify-tests.el | | | 21 | +++++++++++++++++++++ |
1 file changed, 21 insertions(+), 0 deletions(-)
diff --git a/emojify-tests.el b/emojify-tests.el @@ -334,6 +334,27 @@ Helps isolate tests from each other's customizations." (goto-char (point-min)) (emojify-tests-should-be-emojified (line-beginning-position 2))))) +(ert-deftest emojify-tests-uncover-on-isearch-multiple-matches () + (emojify-tests-with-emojified-buffer "Testing isearch\n:book:\n:books:" + (let ((first-emoji-pos (line-beginning-position 2)) + (second-emoji-pos (line-beginning-position 3))) + (with-mock + ;; We do not want to be bothered with isearch messages + (stub message => nil) + (emojify-tests-should-be-emojified first-emoji-pos) + (emojify-tests-should-be-emojified second-emoji-pos) + + (isearch-mode +1) + (execute-kbd-macro ":book") + (isearch-repeat-forward) + ;; (emojify-tests-should-be-emojified first-emoji-pos) + (emojify-tests-should-be-uncovered second-emoji-pos) + (isearch-exit) + ;; Emoji should be restored on leaving the underlying text + (goto-char (point-min)) + (emojify-tests-should-be-emojified first-emoji-pos) + (emojify-tests-should-be-emojified second-emoji-pos))))) + ;; So that tests can be run simply by doing `eval-buffer' (unless noninteractive (ert "^emojify-"))