unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#65738: [PATCH] Fix java-ts-mode tests
@ 2023-09-04 16:42 john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-07  9:07 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-04 16:42 UTC (permalink / raw)
  To: 65738; +Cc: Theodor Thornhill

[-- Attachment #1: Type: text/plain, Size: 3392 bytes --]

Tags: patch

Attached is a patch to make the java-ts-mode tests pass (and adds Java
to the build-module script). Currently they fail with the message:

Running 2 tests (2023-09-04 11:33:58-0500, selector ‘t’)
Test java-ts-mode-test-indentation backtrace:
  cdr(java)
  mapcan(cdr (java (sexp "\\(?:_type\\|a\\(?:ccess\\|nnotation\\|rgume
  treesit-thing-defined-p(sexp nil)
  treesit-major-mode-setup()
  (let ((delay-mode-hooks t)) (prog-mode) (setq major-mode 'java-ts-mo
  (progn (make-local-variable 'delay-mode-hooks) (let ((delay-mode-hoo
  java-ts-mode()
  (lambda nil (setq indent-tabs-mode nil) (setq java-ts-mode-indent-of
  ert-test--erts-test(((dummy . t) (code)) "/home/jm/src/emacs/test/li
  ert-test-erts-file("/home/jm/src/emacs/test/lisp/progmodes/java-ts-m
  (closure (t) nil (let* ((fn-0 #'treesit-ready-p) (args-1 (condition-
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name java-ts-mode-test-indentation :docume
  ert-run-or-rerun-test(#s(ert--stats :selector t :tests [#s(ert-test 
  ert-run-tests(t #f(compiled-function (event-type &rest event-args) #
  ert-run-tests-batch(nil)
  ert-run-tests-batch-and-exit()
  command-line-1(("-l" "/home/jm/src/emacs/lisp/progmodes/java-ts-mode
  command-line()
  normal-top-level()
Test java-ts-mode-test-indentation condition:
    (wrong-type-argument listp java)
   FAILED  1/2  java-ts-mode-test-indentation (0.000824 sec) at test/lisp/progmodes/java-ts-mode-tests.el:26
Test java-ts-mode-test-movement backtrace:
  cdr(java)
  mapcan(cdr (java (sexp "\\(?:_type\\|a\\(?:ccess\\|nnotation\\|rgume
  treesit-thing-defined-p(sexp nil)
  treesit-major-mode-setup()
  (let ((delay-mode-hooks t)) (prog-mode) (setq major-mode 'java-ts-mo
  (progn (make-local-variable 'delay-mode-hooks) (let ((delay-mode-hoo
  java-ts-mode()
  (lambda nil (java-ts-mode) (forward-sentence 1))()
  ert-test--erts-test(((dummy . t) (code)) "/home/jm/src/emacs/test/li
  ert-test-erts-file("/home/jm/src/emacs/test/lisp/progmodes/java-ts-m
  (closure (t) nil (let* ((fn-5 #'treesit-ready-p) (args-6 (condition-
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name java-ts-mode-test-movement :documenta
  ert-run-or-rerun-test(#s(ert--stats :selector t :tests [... ...] :te
  ert-run-tests(t #f(compiled-function (event-type &rest event-args) #
  ert-run-tests-batch(nil)
  ert-run-tests-batch-and-exit()
  command-line-1(("-l" "/home/jm/src/emacs/lisp/progmodes/java-ts-mode
  command-line()
  normal-top-level()
Test java-ts-mode-test-movement condition:
    (wrong-type-argument listp java)
   FAILED  2/2  java-ts-mode-test-movement (0.000795 sec) at test/lisp/progmodes/java-ts-mode-tests.el:30

Ran 2 tests, 0 results as expected, 2 unexpected (2023-09-04 11:33:58-0500, 0.128382 sec)

2 unexpected results:
   FAILED  java-ts-mode-test-indentation
   FAILED  java-ts-mode-test-movement



In GNU Emacs 30.0.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.17.8) of 2023-08-29 built on localhost
Repository revision: fb9312722f7b0166f178b601811213a576be5ae4
Repository branch: main
System Description: Fedora Linux 38 (Workstation Edition)

Configured using:
 'configure --with-native-compilation=aot --with-pgtk
 --prefix=/home/jm/.opt'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-java-ts-mode-tests.patch --]
[-- Type: text/patch, Size: 1824 bytes --]

From ad7ea4451badcb8e43ae92640d4a7c6a8a0e117a Mon Sep 17 00:00:00 2001
From: john muhl <jm@pub.pink>
Date: Mon, 4 Sep 2023 11:36:42 -0500
Subject: [PATCH] Fix java-ts-mode tests

* admin/notes/tree-sitter/build-module/batch.sh (languages):
Add Java.
* lisp/progmodes/java-ts-mode.el (java-ts-mode): Pass a list to
treesit-thing-settings.
---
 admin/notes/tree-sitter/build-module/batch.sh | 1 +
 lisp/progmodes/java-ts-mode.el                | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/admin/notes/tree-sitter/build-module/batch.sh b/admin/notes/tree-sitter/build-module/batch.sh
index 1d4076564dc..3c4e1472c89 100755
--- a/admin/notes/tree-sitter/build-module/batch.sh
+++ b/admin/notes/tree-sitter/build-module/batch.sh
@@ -13,6 +13,7 @@ languages=
     'go-mod'
     'heex'
     'html'
+    'java'
     'javascript'
     'json'
     'python'
diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el
index 863adeb9245..99d34789dcc 100644
--- a/lisp/progmodes/java-ts-mode.el
+++ b/lisp/progmodes/java-ts-mode.el
@@ -356,7 +356,7 @@ java-ts-mode
   (setq-local treesit-defun-name-function #'java-ts-mode--defun-name)
 
   (setq-local treesit-thing-settings
-              `(java
+              `((java
                 (sexp ,(rx (or "annotation"
                                "parenthesized_expression"
                                "argument_list"
@@ -378,7 +378,7 @@ java-ts-mode
                                    "import_declaration")))
                 (text ,(regexp-opt '("line_comment"
                                      "block_comment"
-                                     "text_block")))))
+                                     "text_block"))))))
 
   ;; Font-lock.
   (setq-local treesit-font-lock-settings java-ts-mode--font-lock-settings)
-- 
2.41.0


[-- Attachment #3.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #3.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 503 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#65738: [PATCH] Fix java-ts-mode tests
  2023-09-04 16:42 bug#65738: [PATCH] Fix java-ts-mode tests john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-07  9:07 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2023-09-07  9:07 UTC (permalink / raw)
  To: john muhl; +Cc: 65738-done, theo

> Cc: Theodor Thornhill <theo@thornhill.no>
> Date: Mon, 04 Sep 2023 11:42:18 -0500
> From:  john muhl via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> Attached is a patch to make the java-ts-mode tests pass (and adds Java
> to the build-module script). Currently they fail with the message:

Thanks, installed on master, and closing the bug.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-07  9:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-04 16:42 bug#65738: [PATCH] Fix java-ts-mode tests john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-07  9:07 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).