From: Yuan Fu Date: Sun, 15 Sep 2024 07:42:41 +0000 (-0700) Subject: ; Add even more tests for previous commit X-Git-Tag: archive/raspbian/1%30.1+1-3+rpi1^2~2^2~20^2~401 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ae22ad7f624afa5e974059b8f2e78959402d8b3a;p=emacs.git ; Add even more tests for previous commit * test/src/treesit-tests.el: (treesit-range-fixup-after-edit): Make the tests trickier. --- 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.)" (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)