From: Denis Zubarev Date: Sat, 11 Nov 2023 22:42:42 +0000 (+0300) Subject: Fix treesit test (bug#67117) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7a00ca92c191a8d105283f73e9b68f6a0378a3a0;p=emacs.git Fix treesit test (bug#67117) * test/src/treesit-tests.el (treesit-search-subtree-forward-1): (treesit-search-subtree-backward-1): Replace treesit--thing-at with treesit-query-capture (treesit--thing-at isn't available in Emacs 29). --- diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el index 9ba3a9340c1..1763c3894f5 100644 --- a/test/src/treesit-tests.el +++ b/test/src/treesit-tests.el @@ -1090,9 +1090,12 @@ This tests bug#60355." (python-ts-mode) (insert "Temp(1, 2)") (goto-char (point-min)) - (let ((node (treesit-search-subtree - (treesit--thing-at (point) "call") - (lambda (n) (equal (treesit-node-type n ) "integer"))))) + (pcase-let* ((`((,_ . ,call-node)) + (treesit-query-capture (treesit-buffer-root-node) + '((call) @c))) + (node (treesit-search-subtree + call-node + (lambda (n) (equal (treesit-node-type n) "integer"))))) (should node) (should (equal (treesit-node-text node) "1")))) @@ -1104,10 +1107,13 @@ This tests bug#60355." (python-ts-mode) (insert "Temp(1, 2)") (goto-char (point-min)) - (let ((node (treesit-search-subtree - (treesit--thing-at (point) "call") - (lambda (n) (equal (treesit-node-type n ) "integer")) - t))) + (pcase-let* ((`((,_ . ,call-node)) + (treesit-query-capture (treesit-buffer-root-node) + '((call) @c))) + (node (treesit-search-subtree + call-node + (lambda (n) (equal (treesit-node-type n) "integer")) + t))) (should node) (should (equal (treesit-node-text node) "2"))))