aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorEli Zaretskii2023-12-23 06:30:40 -0500
committerEli Zaretskii2023-12-23 06:30:40 -0500
commit1be62044732df0c4f1be9679a4ada09850a9e2ab (patch)
tree21e801fc520832d37dfcf744c174d55cf2a63d18 /test/src
parentb09765a7114a92fbb71dad50a44a66938723624d (diff)
parenta4751657389cf47c18416fa5d148ad2a67e14565 (diff)
downloademacs-1be62044732df0c4f1be9679a4ada09850a9e2ab.tar.gz
emacs-1be62044732df0c4f1be9679a4ada09850a9e2ab.zip
Merge from origin/emacs-29
a4751657389 * doc/man/emacsclient.1: Fix --tramp option. 1e5357d3d1f * doc/man/emacsclient.1: Add missing sections (bug#66598) fba7b9db397 Add explanation for extra parentheses in ELisp Introduction 77232826821 Add sample code to the "let*" section in "forward-paragraph" 7a00ca92c19 Fix treesit test (bug#67117) d220893216c Fix c++-ts-mode indentation (bug#67975) d386a8aa43f Recommend customizing eglot for python-base-mode bd0c7589715 Improve documentation of new native-compilation commands 1ad126c0f28 ; Fix typo 77678244b83 doc/lispintro: Don't mention `set` (bug#67734) cb3684e9dfa Fix script for some characters 2922d683b78 ; * src/treesit.c (treesit_traverse_child_helper): Fix co... 7b315e8a5c9 Fix an issue when searching subtree backward (bug#67117) 03625c2fefa Fix passive mode for tnftp client in ange-ftp.el. b6429b1c1c7 ; Improve documentation of ispell.el's dictionary database 75cc1593412 ; * etc/PROBLEMS: Update the "GnuPG hangs" entry. 67d9af1c074 Fix using disabled command without a docstring f68f3500236 Improve documentation of text properties handling when ya... 06c399914fa Eglot: Add Uiua language server
Diffstat (limited to 'test/src')
-rw-r--r--test/src/treesit-tests.el36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el
index 791e902bd0a..e5f3a5d992e 100644
--- a/test/src/treesit-tests.el
+++ b/test/src/treesit-tests.el
@@ -1167,6 +1167,42 @@ This tests bug#60355."
1167 treesit--ert-defun-navigation-top-level-master 1167 treesit--ert-defun-navigation-top-level-master
1168 'top-level)) 1168 'top-level))
1169 1169
1170(ert-deftest treesit-search-subtree-forward-1 ()
1171 "Test search subtree forward."
1172 (skip-unless (treesit-language-available-p 'python))
1173 (require 'python)
1174 (python-ts-mode)
1175 (insert "Temp(1, 2)")
1176 (goto-char (point-min))
1177 (pcase-let* ((`((,_ . ,call-node))
1178 (treesit-query-capture (treesit-buffer-root-node)
1179 '((call) @c)))
1180 (node (treesit-search-subtree
1181 call-node
1182 (lambda (n) (equal (treesit-node-type n) "integer")))))
1183
1184 (should node)
1185 (should (equal (treesit-node-text node) "1"))))
1186
1187(ert-deftest treesit-search-subtree-backward-1 ()
1188 "Test search subtree with backward=t."
1189 (skip-unless (treesit-language-available-p 'python))
1190 (require 'python)
1191 (python-ts-mode)
1192 (insert "Temp(1, 2)")
1193 (goto-char (point-min))
1194 (pcase-let* ((`((,_ . ,call-node))
1195 (treesit-query-capture (treesit-buffer-root-node)
1196 '((call) @c)))
1197 (node (treesit-search-subtree
1198 call-node
1199 (lambda (n) (equal (treesit-node-type n) "integer"))
1200 t)))
1201
1202 (should node)
1203 (should (equal (treesit-node-text node) "2"))))
1204
1205
1170;; TODO 1206;; TODO
1171;; - Functions in treesit.el 1207;; - Functions in treesit.el
1172;; - treesit-load-name-override-list 1208;; - treesit-load-name-override-list