tests: build-emacs-utils: Allow test to pass on Emacs 27 too.

* tests/build-emacs-utils.scm
("emacs-batch-script: raise &emacs-batch-error on failure"): More loosely
match expected error string, which differs between Emacs 27 and Emacs 28.
This commit is contained in:
Maxim Cournoyer 2022-07-13 10:21:38 -04:00
parent e1a8100936
commit dcf133587a
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -23,6 +23,7 @@ (define-module (test build-emacs-utils)
#:use-module (guix build utils) #:use-module (guix build utils)
#:use-module ((guix utils) #:use-module ((guix utils)
#:select (call-with-temporary-directory)) #:select (call-with-temporary-directory))
#:use-module (ice-9 regex)
#:use-module (srfi srfi-34) #:use-module (srfi srfi-34)
#:use-module (srfi srfi-64)) #:use-module (srfi srfi-64))
@ -36,8 +37,10 @@ (define-module (test build-emacs-utils)
(test-assert "emacs-batch-script: raise &emacs-batch-error on failure" (test-assert "emacs-batch-script: raise &emacs-batch-error on failure"
(guard (c ((emacs-batch-error? c) (guard (c ((emacs-batch-error? c)
(string-contains (emacs-batch-error-message c) ;; The error message format changed between Emacs 27 and Emacs
"Lisp error: (wrong-type-argument numberp \"three\")"))) ;; 28.
(string-match "[Ww]rong.*argument.*numberp.*\"three\""
(emacs-batch-error-message c))))
(emacs-batch-script '(mapcar 'number-to-string (list 1 2 "three"))))) (emacs-batch-script '(mapcar 'number-to-string (list 1 2 "three")))))
(call-with-temporary-directory (call-with-temporary-directory