1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-07 04:10:27 -08:00

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.
This commit is contained in:
Yuan Fu 2024-08-24 15:03:28 -07:00
parent 4339e70a94
commit ac98ff18f4
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View file

@ -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.