]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix recent test regressions
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 22 Mar 2024 22:44:54 +0000 (18:44 -0400)
committerEshel Yaron <me@eshelyaron.com>
Sun, 24 Mar 2024 14:20:40 +0000 (15:20 +0100)
* lisp/emacs-lisp/pp.el (pp-fill): Don't cut between `#` and `(`.

* test/lisp/help-fns-tests.el (help-fns-test-built-in)
(help-fns-test-interactive-built-in, help-fns-test-lisp-defun)
(help-fns-test-lisp-defsubst):
* test/src/emacs-module-tests.el (module/describe-function-1):
Adjust tests to new wording in `describe-function`.

(cherry picked from commit 7e32e8392ab77f9df08a1f11831cbba2242d721f)

lisp/emacs-lisp/pp.el
test/lisp/help-fns-tests.el
test/src/emacs-module-tests.el

index b48f44545bfec1ae39975109c11bee836237e7a0..26c77d6b047658aeebc415b743b81221a2902da8 100644 (file)
@@ -198,7 +198,10 @@ it inserts and pretty-prints that arg at point."
                       ;; reduce the indentation depth.
                       ;; Similarly, we prefer to cut before a "." than after
                       ;; it because it reduces the indentation depth.
-                      (skip-chars-backward " \t({[',.")
+                      (while (not (zerop (skip-chars-backward " \t({[',.")))
+                        (and (memq (char-before) '(?# ?s ?f))
+                             (looking-back "#[sf]?" (- (point) 2))
+                             (goto-char (match-beginning 0))))
                       (if (bolp)
                           ;; The sexp already starts on its own line.
                           (progn (goto-char beg) nil)
index 7035c8b7773d5cb634e244f780765e92370e4de9..1beeb77640c754229f4443a8a6f7e1e71d2da942 100644 (file)
@@ -48,12 +48,12 @@ Return first line of the output of (describe-function-1 FUNC)."
     (should (string-match regexp result))))
 
 (ert-deftest help-fns-test-built-in ()
-  (let ((regexp "a built-in function in .C source code")
+  (let ((regexp "a primitive-function in .C source code")
         (result (help-fns-tests--describe-function 'mapcar)))
     (should (string-match regexp result))))
 
 (ert-deftest help-fns-test-interactive-built-in ()
-  (let ((regexp "an interactive built-in function in .C source code")
+  (let ((regexp "an interactive primitive-function in .C source code")
         (result (help-fns-tests--describe-function 're-search-forward)))
     (should (string-match regexp result))))
 
@@ -64,13 +64,13 @@ Return first line of the output of (describe-function-1 FUNC)."
 
 (ert-deftest help-fns-test-lisp-defun ()
   (let ((regexp (if (featurep 'native-compile)
-                    "a native-compiled Lisp function in .+subr\\.el"
-                  "a byte-compiled Lisp function in .+subr\\.el"))
+                    "a subr-native-elisp in .+subr\\.el"
+                  "a compiled-function in .+subr\\.el"))
         (result (help-fns-tests--describe-function 'last)))
     (should (string-match regexp result))))
 
 (ert-deftest help-fns-test-lisp-defsubst ()
-  (let ((regexp "a byte-compiled Lisp function in .+subr\\.el")
+  (let ((regexp "a compiled-function in .+subr\\.el")
         (result (help-fns-tests--describe-function 'posn-window)))
     (should (string-match regexp result))))
 
index fd0647275a0b5863e829cb714939c298f39c9533..052fd83dc859312bd2ec9e3eae08f20afb12d9fd 100644 (file)
@@ -315,7 +315,7 @@ local reference."
         (replace-match "`src/emacs-module-resources/"))
       (should (equal
                (buffer-substring-no-properties 1 (point-max))
-               (format "a module function in `src/emacs-module-resources/mod-test%s'.
+               (format "a module-function in `src/emacs-module-resources/mod-test%s'.
 
 (mod-test-sum a b)