aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lisp/dabbrev-tests.el30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/lisp/dabbrev-tests.el b/test/lisp/dabbrev-tests.el
index a6ab2e7201f..d26362db3d4 100644
--- a/test/lisp/dabbrev-tests.el
+++ b/test/lisp/dabbrev-tests.el
@@ -40,3 +40,33 @@ first expansion being replaced rather than the destination."
40 ;; M-/ SPC M-/ M-/ 40 ;; M-/ SPC M-/ M-/
41 (execute-kbd-macro "\257 \257\257")) 41 (execute-kbd-macro "\257 \257\257"))
42 (should (string= (buffer-string) "ab x\nab y\nab y")))) 42 (should (string= (buffer-string) "ab x\nab y\nab y"))))
43
44(ert-deftest dabbrev-completion-test ()
45 "Test for bug#17899.
46dabbrev-completion should not look for expansions in other
47buffers unless a prefix argument is used."
48 (with-temp-buffer
49 (insert "axy")
50 (with-temp-buffer
51 (insert "abc\na")
52 (goto-char 6)
53 (save-window-excursion
54 (set-window-buffer nil (current-buffer))
55 ;; C-M-/
56 (execute-kbd-macro [201326639]))
57 (should (string= (buffer-string) "abc\nabc")))))
58
59(ert-deftest dabbrev-completion-test-with-argument ()
60 "Test for bug#17899.
61dabbrev-completion should not complete because it has found
62multiple expansions."
63 (with-temp-buffer
64 (insert "axy")
65 (with-temp-buffer
66 (insert "abc\na")
67 (goto-char 6)
68 (save-window-excursion
69 (set-window-buffer nil (current-buffer))
70 ;; C-u C-u C-M-/
71 (execute-kbd-macro [21 21 201326639]))
72 (should (string= (buffer-string) "abc\na")))))