diff options
| author | Yuan Fu | 2024-08-24 15:03:28 -0700 |
|---|---|---|
| committer | Yuan Fu | 2024-08-24 15:15:27 -0700 |
| commit | ac98ff18f4debb935e07d3739fcc3378359d8d82 (patch) | |
| tree | 82e38215a83524028f07ac1d83a55f6ebbfc7f4c /test/src | |
| parent | 4339e70a942770ce4e17d16a9708e4bdf5630514 (diff) | |
| download | emacs-ac98ff18f4debb935e07d3739fcc3378359d8d82.tar.gz emacs-ac98ff18f4debb935e07d3739fcc3378359d8d82.zip | |
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.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/treesit-tests.el | 10 |
1 files changed, 6 insertions, 4 deletions
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 @@ | |||
| 199 | (with-current-buffer base | 199 | (with-current-buffer base |
| 200 | (setq indirect (clone-indirect-buffer "*treesit test 1*" nil))) | 200 | (setq indirect (clone-indirect-buffer "*treesit test 1*" nil))) |
| 201 | (with-current-buffer indirect | 201 | (with-current-buffer indirect |
| 202 | (setq parser (treesit-parser-create 'json))) | 202 | (setq parser (treesit-parser-create 'json)) |
| 203 | ;; 1. Parser created in the indirect buffer should be | 203 | (should (equal (list parser) (treesit-parser-list)))) |
| 204 | ;; actually be created in the base buffer. | 204 | ;; 1. Parser created in the indirect buffer should not appear |
| 205 | ;; in the base buffer. | ||
| 205 | (with-current-buffer base | 206 | (with-current-buffer base |
| 206 | (should (equal (list parser) | 207 | (should (equal nil |
| 207 | (treesit-parser-list))) | 208 | (treesit-parser-list))) |
| 209 | (treesit-parser-create 'json) | ||
| 208 | (insert "[1,2,3]")) | 210 | (insert "[1,2,3]")) |
| 209 | ;; Change in the base buffer should be reflected in the | 211 | ;; Change in the base buffer should be reflected in the |
| 210 | ;; indirect buffer. | 212 | ;; indirect buffer. |