diff mbox series

[bug#66016,emacs-team,7/7] gnu: emacs-rjsx-mode: Fix build.

Message ID 10664c0f1c351eae24629127d97fe23f5e18a93c.1694805225.git.liliana.prikler@gmail.com
State New
Headers show
Series Fix failing builds | expand

Commit Message

Liliana Marie Prikler Sept. 15, 2023, 7:11 p.m. UTC
* gnu/packages/emacs-xyz.scm (emacs-rjsx-mode)[#:phases]: Add
‘js2-number-tests’.
---
 gnu/packages/emacs-xyz.scm | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

Comments

Liliana Marie Prikler Sept. 22, 2023, 11:27 p.m. UTC | #1
Am Freitag, dem 15.09.2023 um 21:11 +0200 schrieb Liliana Marie
Prikler:
> * gnu/packages/emacs-xyz.scm (emacs-rjsx-mode)[#:phases]: Add
> ‘js2-number-tests’.
> ---
Pushed along with the rest.

Cheers
diff mbox series

Patch

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 6b4c23290c..6ca833b484 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -31014,7 +31014,25 @@  (define-public emacs-rjsx-mode
      (list emacs-js2-mode))
     (arguments
      `(#:tests? #t
-       #:test-command '("make" "test")))
+       #:test-command '("make" "test")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'js2-number-tests
+           (lambda _
+             ((lambda (file test-name)     ; variant of ert-number-tests
+                (emacs-batch-edit-file file
+                  `(let ((i 0))
+                     (while (re-search-forward
+                             ,(string-append "js2-deftest-parse "
+                                             test-name)
+                             nil t)
+                       (goto-char (match-beginning 0))
+                       (kill-region (match-beginning 0) (match-end 0))
+                       (insert (format "xt-deftest %s-%d" ,test-name i))
+                       (setq i (+ i 1)))
+                     (basic-save-buffer))))
+                "rjsx-tests.el.el"
+                "no-attr-no-children-self-closing"))))))
     (home-page "https://github.com/felipeochoa/rjsx-mode")
     (synopsis "Major mode for JSX files")
     (description "This package extends the parser of @code{js2-mode} to