aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPo Lu2022-12-11 09:34:03 +0800
committerPo Lu2022-12-11 09:34:03 +0800
commit6d6ca47aba7b72d2a770d7ed01c849d3cc729e21 (patch)
treee8181f7188a3a74147549b7ba76ea9c3a696259c /test
parente08564432918aa87b49da58ac90bb43718424364 (diff)
parent44c5f3614973d8dc389ddcdc1b3f8ab1c809194d (diff)
downloademacs-6d6ca47aba7b72d2a770d7ed01c849d3cc729e21.tar.gz
emacs-6d6ca47aba7b72d2a770d7ed01c849d3cc729e21.zip
Merge from origin/emacs-29
44c5f361497 ; Fix two byte-compiler warnings a8ee046fb50 Ensure 'package-vc--version' always returns a version 022ab1061b2 Ensure 'package-vc--main-file' always returns an existing... 357fe91996b Check if package already exists before installing from ch... 5e8bc79f6b2 ; Fix reference in docstring to 'package-vc-install-from-... af88b00b19c Refresh the package quickstart file in package-vc 5a092c8e461 ; * admin/notes/tree-sitter/starter-guide (Indent): Minor... ebef8905b0d Make indirect buffers use tree-sitter parsers of their ba... 8f53fa10d94 Fontify "this" as a keyword in c++-ts-mode (bug#59924) 8de8f1dc051 Add class_body indentation for typescript (bug#59680) 839341d7370 Make more granular defun-type-regexp (bug#59873) 8f49137c9bf Add dockerfile-ts-mode (Bug#59894) 1014bcc8e32 Fix fontification of method-invocations in js-ts-mode (bu... 7141920c6af Fix escape-sequence feature in typescript-ts-mode (bug#59... 4df35e3491c Improve fontification in csharp-ts-mode (bug#59909) 33a8415eb7e Use 'project--value-in-dir' for 'project-vc-include-untra... 594267395d5 Update Turkish Hello 940d9070e97 Support newer glib versions (Bug#59061) 0bd26abf7fb ; * doc/misc/use-package.texi: Fix @file. bcf235acd58 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/... 2ea7a357fd1 ; * doc/misc/use-package.texi: Fix @acronym. d268ab1c5d7 Bring back the project--value-in-dir logic
Diffstat (limited to 'test')
-rw-r--r--test/lisp/progmodes/project-resources/.dir-locals.el1
-rw-r--r--test/lisp/progmodes/project-resources/etc1
-rw-r--r--test/lisp/progmodes/project-resources/foo1
-rw-r--r--test/lisp/progmodes/project-tests.el15
-rw-r--r--test/src/treesit-tests.el34
5 files changed, 51 insertions, 1 deletions
diff --git a/test/lisp/progmodes/project-resources/.dir-locals.el b/test/lisp/progmodes/project-resources/.dir-locals.el
new file mode 100644
index 00000000000..a311b7efa9a
--- /dev/null
+++ b/test/lisp/progmodes/project-resources/.dir-locals.el
@@ -0,0 +1 @@
((nil . ((project-vc-ignores . ("etc")))))
diff --git a/test/lisp/progmodes/project-resources/etc b/test/lisp/progmodes/project-resources/etc
new file mode 100644
index 00000000000..dd7999bd3dd
--- /dev/null
+++ b/test/lisp/progmodes/project-resources/etc
@@ -0,0 +1 @@
etc \ No newline at end of file
diff --git a/test/lisp/progmodes/project-resources/foo b/test/lisp/progmodes/project-resources/foo
new file mode 100644
index 00000000000..19102815663
--- /dev/null
+++ b/test/lisp/progmodes/project-resources/foo
@@ -0,0 +1 @@
foo \ No newline at end of file
diff --git a/test/lisp/progmodes/project-tests.el b/test/lisp/progmodes/project-tests.el
index c3b886873d3..8814f30b047 100644
--- a/test/lisp/progmodes/project-tests.el
+++ b/test/lisp/progmodes/project-tests.el
@@ -41,7 +41,7 @@ quoted directory names (Bug#47799)."
41 (skip-unless (executable-find "grep")) 41 (skip-unless (executable-find "grep"))
42 (ert-with-temp-directory directory 42 (ert-with-temp-directory directory
43 (let ((default-directory directory) 43 (let ((default-directory directory)
44 (project-current-inhibit-prompt t) 44 (project-current-directory-override t)
45 (project-find-functions nil) 45 (project-find-functions nil)
46 (project-list-file 46 (project-list-file
47 (expand-file-name "projects" directory)) 47 (expand-file-name "projects" directory))
@@ -139,4 +139,17 @@ When `project-ignores' includes a name matching project dir."
139 (should-not (null project)) 139 (should-not (null project))
140 (should (string-match-p "/test/lisp/\\'" (project-root project))))) 140 (should (string-match-p "/test/lisp/\\'" (project-root project)))))
141 141
142(ert-deftest project-vc-supports-project-in-different-dir ()
143 "Check that it picks up dir-locals settings from somewhere else."
144 (skip-unless (eq (vc-responsible-backend default-directory) 'Git))
145 (let* ((dir (ert-resource-directory))
146 (_ (vc-file-clearprops dir))
147 (project-vc-extra-root-markers '(".dir-locals.el"))
148 (project (project-current nil dir)))
149 (should-not (null project))
150 (should (string-match-p "/test/lisp/progmodes/project-resources/\\'" (project-root project)))
151 (should (member "etc" (project-ignores project dir)))
152 (should (equal '(".dir-locals.el" "foo")
153 (mapcar #'file-name-nondirectory (project-files project))))))
154
142;;; project-tests.el ends here 155;;; project-tests.el ends here
diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el
index aba12759c34..1cc2217bd3b 100644
--- a/test/src/treesit-tests.el
+++ b/test/src/treesit-tests.el
@@ -161,6 +161,40 @@
161 (should (treesit-node-eq root-node root-node)) 161 (should (treesit-node-eq root-node root-node))
162 (should (not (treesit-node-eq root-node doc-node)))))) 162 (should (not (treesit-node-eq root-node doc-node))))))
163 163
164(ert-deftest treesit-indirect-buffer ()
165 "Tests for indirect buffers."
166 (skip-unless (treesit-language-available-p 'json))
167 (let ((base (get-buffer-create "*treesit test*"))
168 parser indirect)
169 (unwind-protect
170 (progn
171 (with-current-buffer base
172 (setq indirect (clone-indirect-buffer "*treesit test 1*" nil)))
173 (with-current-buffer indirect
174 (setq parser (treesit-parser-create 'json)))
175 ;; 1. Parser created in the indirect buffer should be
176 ;; actually be created in the base buffer.
177 (with-current-buffer base
178 (should (equal (list parser)
179 (treesit-parser-list)))
180 (insert "[1,2,3]"))
181 ;; Change in the base buffer should be reflected in the
182 ;; indirect buffer.
183 (with-current-buffer indirect
184 (should (eq (treesit-node-end
185 (treesit-buffer-root-node))
186 8))
187 (erase-buffer))
188 ;; Change in the indirect buffer should be reflected in the
189 ;; base buffer.
190 (with-current-buffer base
191 (should (eq (treesit-node-end
192 (treesit-buffer-root-node))
193 1))
194 (erase-buffer)))
195 (kill-buffer base)
196 (kill-buffer indirect))))
197
164(ert-deftest treesit-query-api () 198(ert-deftest treesit-query-api ()
165 "Tests for query API." 199 "Tests for query API."
166 (skip-unless (treesit-language-available-p 'json)) 200 (skip-unless (treesit-language-available-p 'json))