From d8c596f7309bd6fd6e127b8027dfb4c508afd2ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Mon, 28 Dec 2020 09:10:19 +0000 Subject: [PATCH] Robustify a helper function for test/lisp/minibuffer-tests.el completion--pcm-first-difference-pos wasn't taking into account the fact that faces may come in lists. bug#42149 * test/lisp/minibuffer-tests.el (completion--pcm-first-difference-pos): Robustify. --- test/lisp/minibuffer-tests.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el index d665587ba26..381096f8c5c 100644 --- a/test/lisp/minibuffer-tests.el +++ b/test/lisp/minibuffer-tests.el @@ -112,11 +112,14 @@ (get-text-property 0 'completion-score comp)) (defun completion--pcm-first-difference-pos (comp) - (cl-loop for pos = (next-single-property-change 0 'face comp) + (cl-loop with faces + for pos = (next-single-property-change 0 'face comp) then (next-single-property-change pos 'face comp) while pos - when (eq (get-text-property pos 'face comp) - 'completions-first-difference) + when (or (eq (setq faces (get-text-property pos 'face comp)) + 'completions-first-difference) + (and (listp faces) + (memq 'completions-first-difference faces))) return pos)) (ert-deftest completion-pcm-test-1 () -- 2.39.2