testing/lisp/test-duplicates-detector.el: Fix Emacs 27 compatibility

*
testing/lisp/test-duplicates-detector.el (test-duplicates-detector--find-duplicates):
Do not use `while-let' that is not yet available in Emacs 27.
This commit is contained in:
Ihor Radchenko 2024-02-11 15:11:11 +01:00
parent 112f1c5fcd
commit 130382779b
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 20 additions and 19 deletions

View File

@ -145,25 +145,26 @@ Duplicate forms will be written to
(goto-char (point-min)) (goto-char (point-min))
(while (search-forward "(ert-deftest" nil t) (while (search-forward "(ert-deftest" nil t)
(goto-char (match-beginning 0)) (goto-char (match-beginning 0))
(ignore-errors (let (deftest test-name)
(while-let ((deftest (or (read (current-buffer)) t)) (ignore-errors
((eq (car deftest) 'ert-deftest)) (while (setq deftest (read (current-buffer)))
(test-name (cadr deftest))) (setq test-name (cadr deftest))
(if-let ((f (seq-find (when (eq (car deftest) 'ert-deftest)
(lambda (x) (if-let ((f (seq-find
(equal-including-properties (lambda (x)
;; if cadddr is a docstring (equal-including-properties
(if (stringp (cadddr deftest)) ;; if cadddr is a docstring
(cddddr deftest) (if (stringp (cadddr deftest))
(cdddr deftest)) (cddddr deftest)
(if (stringp (cadddr x)) (cdddr deftest))
(cddddr x) (if (stringp (cadddr x))
(cdddr x)))) (cddddr x)
found-deftests))) (cdddr x))))
(push (cons test-name (cadr f)) duplicate-tests) found-deftests)))
(push deftest found-deftests) (push (cons test-name (cadr f)) duplicate-tests)
(test-duplicates-detector--search-forms-recursively (push deftest found-deftests)
deftest (list file test-name))))))))) (test-duplicates-detector--search-forms-recursively
deftest (list file test-name)))))))))))
(setq test-duplicates-detector-duplicate-forms (setq test-duplicates-detector-duplicate-forms
(seq-filter (seq-filter
#'cdr #'cdr