1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-21 06:55:39 +00:00

; Add even more tests for previous commit

* test/src/treesit-tests.el:
(treesit-range-fixup-after-edit): Make the tests trickier.
This commit is contained in:
Yuan Fu 2024-09-15 00:42:41 -07:00
parent 460b9d705a
commit ae22ad7f62
No known key found for this signature in database
GPG Key ID: 56E19BC57664A442

View File

@ -711,21 +711,23 @@ visible_end.)"
(should (equal (treesit-parser-included-ranges parser)
'((5 . 7) (10 . 13))))
;; Narrow in front.
;; Narrow in front, and discard the last one.
(widen)
(treesit-parser-set-included-ranges parser '((4 . 17)))
(treesit-parser-set-included-ranges
parser '((4 . 10) (12 . 14) (16 . 20)))
;; 11111111111111111111
;; [ ]
;; [ ] [ ] [ ]
;; { } narrow
(narrow-to-region 1 8)
(should (equal (treesit-parser-included-ranges parser)
'((4 . 8))))
;; Narrow in back.
;; Narrow in back, and discard the first one.
(widen)
(treesit-parser-set-included-ranges parser '((4 . 17)))
(treesit-parser-set-included-ranges
parser '((1 . 5) (7 . 9) (11 . 17)))
;; 11111111111111111111
;; [ ]
;; [ ] [ ] [ ]
;; { } narrow
(narrow-to-region 15 20)
(should (equal (treesit-parser-included-ranges parser)