aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp
diff options
context:
space:
mode:
authorJoão Távora2023-11-11 15:29:46 +0000
committerJoão Távora2023-11-11 16:13:52 +0000
commitfff9b6e37aaf7da22cf803441b96f47ddd92a027 (patch)
tree21b0a34ae172e71d98702a30562b6193bfa45bb2 /test/lisp
parentc9d7740574758d47c8864cbada5fd2a2b2ee8911 (diff)
downloademacs-fff9b6e37aaf7da22cf803441b96f47ddd92a027.tar.gz
emacs-fff9b6e37aaf7da22cf803441b96f47ddd92a027.zip
Fix test failures in test/lisp/minibuffer-tests.el
bug#48841, bug#47711 In some instances the test code needed to be updated to make different assumptions about implementation details. In others, like the ones about the completions-first-difference face, minor parts of the actual user-visible behaviour were broken. * test/lisp/minibuffer-tests.el (completion-test1): Robustify test. (completion--pcm-score): Don't assume completion-score is stored in string as a property. * lisp/minibuffer.el (completion--hilit-from-re): Take new parameter. (completion-pcm--hilit-commonality): Use it.
Diffstat (limited to 'test/lisp')
-rw-r--r--test/lisp/minibuffer-tests.el16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el
index 27d71805502..28bca60b189 100644
--- a/test/lisp/minibuffer-tests.el
+++ b/test/lisp/minibuffer-tests.el
@@ -33,14 +33,13 @@
33 33
34(ert-deftest completion-test1 () 34(ert-deftest completion-test1 ()
35 (with-temp-buffer 35 (with-temp-buffer
36 (cl-flet* ((test/completion-table (_string _pred action) 36 (cl-flet* ((test/completion-table (string pred action)
37 (if (eq action 'lambda) 37 (let ((completion-ignore-case t))
38 nil 38 (complete-with-action action '("test: ") string pred)))
39 "test: "))
40 (test/completion-at-point () 39 (test/completion-at-point ()
41 (list (copy-marker (point-min)) 40 (list (copy-marker (point-min))
42 (copy-marker (point)) 41 (copy-marker (point))
43 #'test/completion-table))) 42 #'test/completion-table)))
44 (let ((completion-at-point-functions (list #'test/completion-at-point))) 43 (let ((completion-at-point-functions (list #'test/completion-at-point)))
45 (insert "TEST") 44 (insert "TEST")
46 (completion-at-point) 45 (completion-at-point)
@@ -190,7 +189,8 @@
190 189
191(defun completion--pcm-score (comp) 190(defun completion--pcm-score (comp)
192 "Get `completion-score' from COMP." 191 "Get `completion-score' from COMP."
193 (get-text-property 0 'completion-score comp)) 192 ;; FIXME, uses minibuffer.el implementation details
193 (completion--flex-score comp completion-pcm--regexp))
194 194
195(defun completion--pcm-first-difference-pos (comp) 195(defun completion--pcm-first-difference-pos (comp)
196 "Get `completions-first-difference' from COMP." 196 "Get `completions-first-difference' from COMP."