aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
Diffstat (limited to 'test/src')
-rw-r--r--test/src/treesit-tests.el21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el
index f9c64f792d1..22f53243274 100644
--- a/test/src/treesit-tests.el
+++ b/test/src/treesit-tests.el
@@ -411,6 +411,27 @@ BODY is the test body."
411 (let ((missing-bracket (treesit-node-child array -1))) 411 (let ((missing-bracket (treesit-node-child array -1)))
412 (treesit-search-forward missing-bracket "" t)))) 412 (treesit-search-forward missing-bracket "" t))))
413 413
414;;; Indent
415
416(ert-deftest treesit-test-add-simple-indent-rules ()
417 "Test `treesit-add-simple-indent-rules'."
418 (let ((treesit-simple-indent-rules
419 (copy-tree '((c (a a a) (b b b) (c c c))))))
420 (treesit-add-simple-indent-rules 'c '((d d d)))
421 (should (equal treesit-simple-indent-rules
422 '((c (d d d) (a a a) (b b b) (c c c)))))
423 (treesit-add-simple-indent-rules 'c '((e e e)) :after)
424 (should (equal treesit-simple-indent-rules
425 '((c (d d d) (a a a) (b b b) (c c c) (e e e)))))
426 (treesit-add-simple-indent-rules 'c '((f f f)) :after '(b b b))
427 (should (equal treesit-simple-indent-rules
428 '((c (d d d) (a a a) (b b b) (f f f)
429 (c c c) (e e e)))))
430 (treesit-add-simple-indent-rules 'c '((g g g)) :before '(b b b))
431 (should (equal treesit-simple-indent-rules
432 '((c (d d d) (a a a) (g g g)
433 (b b b) (f f f) (c c c) (e e e)))))))
434
414;;; Query 435;;; Query
415 436
416(defun treesit--ert-pred-last-sibling (node) 437(defun treesit--ert-pred-last-sibling (node)