(declare-function treesit-node-descendant-for-range "treesit.c")
(declare-function treesit-node-eq "treesit.c")
+;;; Basic API
(ert-deftest treesit-basic-parsing ()
"Test basic parsing routines."
(should (treesit-node-eq root-node root-node))
(should (not (treesit-node-eq root-node doc-node))))))
+;;; Indirect buffer
+
(ert-deftest treesit-indirect-buffer ()
"Tests for indirect buffers."
(skip-unless (treesit-language-available-p 'json))
(kill-buffer base)
(kill-buffer indirect))))
+;;; Query
+
(ert-deftest treesit-query-api ()
"Tests for query API."
(skip-unless (treesit-language-available-p 'json))
'((type field: (_) @capture :anchor)
:? :* :+ "return")))))))
+;;; Narrow
+
(ert-deftest treesit-narrow ()
"Tests if narrowing works."
(skip-unless (treesit-language-available-p 'json))
;; that calls that.
)))
+;;; Range
+
(ert-deftest treesit-range ()
"Tests if range works."
(skip-unless (treesit-language-available-p 'json))
;; TODO: More tests.
)))
+;;; Multiple language
+
(ert-deftest treesit-multi-lang ()
"Tests if parsing multiple language works."
(skip-unless (and (treesit-language-available-p 'html)
;; TODO: More tests.
)))
+;;; Supplemental functions
+
(ert-deftest treesit-parser-supplemental ()
"Supplemental node functions."
(skip-unless (treesit-language-available-p 'json))