aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorYuan Fu2024-09-15 00:42:41 -0700
committerYuan Fu2024-09-15 00:42:41 -0700
commitae22ad7f624afa5e974059b8f2e78959402d8b3a (patch)
treebfe7129ba4d5c86529e459c0e7db34e4eda59529 /test/src
parent460b9d705ab482003fabe75b0fd1df223abe467c (diff)
downloademacs-ae22ad7f624afa5e974059b8f2e78959402d8b3a.tar.gz
emacs-ae22ad7f624afa5e974059b8f2e78959402d8b3a.zip
; Add even more tests for previous commit
* test/src/treesit-tests.el: (treesit-range-fixup-after-edit): Make the tests trickier.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/treesit-tests.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el
index 68ed6ca751f..6256b1d2fb9 100644
--- a/test/src/treesit-tests.el
+++ b/test/src/treesit-tests.el
@@ -711,21 +711,23 @@ visible_end.)"
711 (should (equal (treesit-parser-included-ranges parser) 711 (should (equal (treesit-parser-included-ranges parser)
712 '((5 . 7) (10 . 13)))) 712 '((5 . 7) (10 . 13))))
713 713
714 ;; Narrow in front. 714 ;; Narrow in front, and discard the last one.
715 (widen) 715 (widen)
716 (treesit-parser-set-included-ranges parser '((4 . 17))) 716 (treesit-parser-set-included-ranges
717 parser '((4 . 10) (12 . 14) (16 . 20)))
717 ;; 11111111111111111111 718 ;; 11111111111111111111
718 ;; [ ] 719 ;; [ ] [ ] [ ]
719 ;; { } narrow 720 ;; { } narrow
720 (narrow-to-region 1 8) 721 (narrow-to-region 1 8)
721 (should (equal (treesit-parser-included-ranges parser) 722 (should (equal (treesit-parser-included-ranges parser)
722 '((4 . 8)))) 723 '((4 . 8))))
723 724
724 ;; Narrow in back. 725 ;; Narrow in back, and discard the first one.
725 (widen) 726 (widen)
726 (treesit-parser-set-included-ranges parser '((4 . 17))) 727 (treesit-parser-set-included-ranges
728 parser '((1 . 5) (7 . 9) (11 . 17)))
727 ;; 11111111111111111111 729 ;; 11111111111111111111
728 ;; [ ] 730 ;; [ ] [ ] [ ]
729 ;; { } narrow 731 ;; { } narrow
730 (narrow-to-region 15 20) 732 (narrow-to-region 15 20)
731 (should (equal (treesit-parser-included-ranges parser) 733 (should (equal (treesit-parser-included-ranges parser)