]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix recently added treesit tests
authorEli Zaretskii <eliz@gnu.org>
Mon, 5 May 2025 12:07:28 +0000 (15:07 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sat, 10 May 2025 08:49:52 +0000 (10:49 +0200)
* test/src/treesit-tests.el (treesit-linecol-basic)
(treesit-linecol-search-back-across-newline)
(treesit-linecol-col-same-line): Skip tests if tree-sitter is not
available.

(cherry picked from commit b84e306be765d5071577f81a12f9557e64732ecf)

test/src/treesit-tests.el

index 368534874395c6e69152a380dbcde7f2b66dc19c..56e40b9882511934dc251b3679f9494ab1562617 100644 (file)
 
 (ert-deftest treesit-linecol-basic ()
   "Tests for basic lincol synchronization."
+  (skip-unless (fboundp 'treesit--linecol-cache))
   (with-temp-buffer
     (should (equal (treesit--linecol-cache)
                    '(:line 0 :col 0 :bytepos 0)))
 
 (ert-deftest treesit-linecol-search-back-across-newline ()
   "Search for newline backwards."
+  (skip-unless (fboundp 'treesit--linecol-at))
   (with-temp-buffer
     (insert "\n ")
     (treesit--linecol-cache-set 2 1 3)
 
 (ert-deftest treesit-linecol-col-same-line ()
   "Test col calculation when cache and target pos is in the same line."
+  (skip-unless (fboundp 'treesit--linecol-at))
   (with-temp-buffer
     (insert "aaaaaa")
     (treesit--linecol-cache-set 1 5 6)