Skip to content

Commit e3bf19e

Browse files
authored
Merge pull request #1393 from mathjax/update/tools
Update Emacs tools
2 parents 685a53b + c716141 commit e3bf19e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

testsuite/scripts/test-diff.el

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
;;; Tools for working with Jest tests in Emacs.
33
;;;
44
;;;
5-
;;; Copyright (c) 2024 The MathJax Consortium
5+
;;; Copyright (c) 2024-5 The MathJax Consortium
66

77
(require 'ediff)
8+
(require 'cl-lib)
89

910
;;; Jest Tests
1011
;;; ==========
@@ -17,7 +18,7 @@
1718
;;;
1819

1920
(defun jest-find-expected ()
20-
(block find-fail-block
21+
(cl-block find-fail-block
2122
(let ((expected (condition-case nil
2223
(search-forward "Expected value")
2324
(error nil))))
@@ -31,19 +32,19 @@
3132
(defun jest-find-fail ()
3233
;; Returns start end for actual and expected and position of fail o/w nil.
3334
(interactive)
34-
(block find-fail-block
35+
(cl-block find-fail-block
3536
(let ((pos (condition-case nil
3637
(search-forward "" nil t)
3738
(error nil))))
3839
(when (null pos)
39-
(return-from find-fail-block nil))
40+
(cl-return-from find-fail-block nil))
4041
(let ((expected (jest-find-expected))
4142
(actual (condition-case nil
4243
(search-forward "Received:")
4344
(error nil)))
4445
)
4546
(when (or (null actual) (null expected))
46-
(return-from find-fail-block nil))
47+
(cl-return-from find-fail-block nil))
4748
(let* ((beg1 (progn
4849
(goto-char actual)
4950
(search-forward "\"")
@@ -88,7 +89,7 @@
8889
(condition-case nil
8990
(search-forward "Summary of all failing tests")
9091
(error (beginning-of-buffer)))
91-
(do ((fail (jest-find-fail) (jest-find-fail)))
92+
(cl-do ((fail (jest-find-fail) (jest-find-fail)))
9293
((null fail) nil)
9394
(print fail)
9495
(append-to-buffer bufferA (caadr fail) (cdadr fail))
@@ -102,7 +103,7 @@
102103
;;; Go to position where you want the next test inserted.
103104
(defun jest-replace-expected-for-actual ()
104105
(interactive)
105-
(block expected-block
106+
(cl-block expected-block
106107
(other-window 1)
107108
(let* ((fail (jest-find-fail))
108109
(actual (car (fourth fail)))

0 commit comments

Comments
 (0)