branch: externals/relint
commit 17152be9d4f2059cc593f73cd5cd10a345515318
Author: Basil L. Contovounesios <[email protected]>
Commit: Basil L. Contovounesios <[email protected]>

    Fix tests with ?\x error on Emacs master (30.0)
    
    The error message changed from "Invalid escape character syntax" to
    "Invalid escape char syntax: \x not followed by hex digit".
    
    Compute the error message dynamically instead of hard-coding it.
---
 relint-test.el | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/relint-test.el b/relint-test.el
index 14f057edd6..0c1cbf9c92 100644
--- a/relint-test.el
+++ b/relint-test.el
@@ -175,15 +175,17 @@ and a path."
             (emacs-lisp-mode)
             (insert "(print \"c \\xf \\xg \\x d\")\n"))
           (let* ((diags (relint-buffer buf))
-                 (err (assoc "(error \"Invalid escape character syntax\")"
-                             diags)))
+                 (err (condition-case err
+                          (read-from-string "?\\x")
+                        (error (prin1-to-string err)))))
             (should (equal
-                     (remove err diags)
-                   '(("Character escape `\\x' not followed by hex digit"
-                      15 nil nil nil warning)
-                     ("Character escape `\\x' not followed by hex digit"
-                      19 nil nil nil warning)
-                     )))))
+                     ;; Ignore 'invalid escape char syntax' error.
+                     (remove (assoc err diags) diags)
+                     '(("Character escape `\\x' not followed by hex digit"
+                        15 nil nil nil warning)
+                       ("Character escape `\\x' not followed by hex digit"
+                        19 nil nil nil warning)
+                       )))))
       (kill-buffer buf))))
 
 (provide 'relint-test)

Reply via email to