From: Yuan Fu Date: Sat, 24 Aug 2024 22:03:28 +0000 (-0700) Subject: Fix tree-sitter test for indirect parser list X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dd055811264c7e94fa0979297aa0d4054a9627f5;p=emacs.git Fix tree-sitter test for indirect parser list * test/src/treesit-tests.el (treesit-indirect-buffer): Now the base buffer shouldn't contain indirect buffer's parsers. (cherry picked from commit ac98ff18f4debb935e07d3739fcc3378359d8d82) --- diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el index 30b15a3c0ce..5b951d35ba1 100644 --- a/test/src/treesit-tests.el +++ b/test/src/treesit-tests.el @@ -199,12 +199,14 @@ (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.