]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix tree-sitter test for indirect parser list
authorYuan Fu <casouri@gmail.com>
Sat, 24 Aug 2024 22:03:28 +0000 (15:03 -0700)
committerEshel Yaron <me@eshelyaron.com>
Wed, 4 Sep 2024 07:51:29 +0000 (09:51 +0200)
* test/src/treesit-tests.el (treesit-indirect-buffer): Now the base
buffer shouldn't contain indirect buffer's parsers.

(cherry picked from commit ac98ff18f4debb935e07d3739fcc3378359d8d82)

test/src/treesit-tests.el

index 30b15a3c0ceaa38bd21d0109eefe2a5f745577b9..5b951d35ba186a25c9157a43b5831e980ed43c9f 100644 (file)
           (with-current-buffer base
             (setq indirect (clone-indirect-buffer "*treesit test 1*" nil)))
           (with-current-buffer indirect
-            (setq parser (treesit-parser-create 'json)))
-          ;; 1. Parser created in the indirect buffer should be
-          ;; actually be created in the base buffer.
+            (setq parser (treesit-parser-create 'json))
+            (should (equal (list parser) (treesit-parser-list))))
+          ;; 1. Parser created in the indirect buffer should not appear
+          ;; in the base buffer.
           (with-current-buffer base
-            (should (equal (list parser)
+            (should (equal nil
                            (treesit-parser-list)))
+            (treesit-parser-create 'json)
             (insert "[1,2,3]"))
           ;; Change in the base buffer should be reflected in the
           ;; indirect buffer.