emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-30 ae22ad7f624: ; Add even more tests for previous commit


From: Yuan Fu
Subject: emacs-30 ae22ad7f624: ; Add even more tests for previous commit
Date: Sun, 15 Sep 2024 03:43:49 -0400 (EDT)

branch: emacs-30
commit ae22ad7f624afa5e974059b8f2e78959402d8b3a
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    ; Add even more tests for previous commit
    
    * test/src/treesit-tests.el:
    (treesit-range-fixup-after-edit): Make the tests trickier.
---
 test/src/treesit-tests.el | 14 ++++++++------
 1 file 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.)"
       (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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]