From 3fff772d8a1f52ef16c6dfb8a6984e6bc0a5f5ba Mon Sep 17 00:00:00 2001 From: Hugo Thunnissen Date: Mon, 12 Aug 2024 11:29:34 +0200 Subject: [PATCH] Fix phpinspect-buffer-index-functions test --- test/test-buffer.el | 67 ++++++++++++++++----------------------------- 1 file changed, 24 insertions(+), 43 deletions(-) diff --git a/test/test-buffer.el b/test/test-buffer.el index 689e7cb..b846adc 100644 --- a/test/test-buffer.el +++ b/test/test-buffer.el @@ -356,56 +356,37 @@ class YYY { (should (= 1 (hash-table-count (phpinspect-project-class-index (phpinspect-buffer-project buffer)))))))) (ert-deftest phpinspect-buffer-index-functions () - (let ((buffer (phpinspect-make-buffer :-project (phpinspect--make-project :autoload (phpinspect-make-autoloader)))) - (namespaces (phpinspect-make-splayt)) - (declarations (phpinspect-make-splayt)) - (classes (phpinspect-make-splayt)) - (functions (phpinspect-make-splayt))) - - (phpinspect-splayt-insert - namespaces 10 - (phpinspect-make-meta nil 10 200 "" '(:namespace (:word "NS") (:terminator ";")))) - - - (phpinspect-splayt-insert - declarations 20 - (phpinspect-make-meta nil 20 30 "" '(:declaration (:word "class") (:word "TestClass")))) - (phpinspect-splayt-insert - classes 20 - (phpinspect-make-meta nil 20 70 "" '(:class (:declaration (:word "class") (:word "TestClass"))))) - - - (phpinspect-splayt-insert - declarations 40 - (phpinspect-make-meta nil 40 45 "" '(:declaration (:word "testMethod") (:list) (:word "RelativeType")))) - - (phpinspect-splayt-insert - functions 40 - (phpinspect-make-meta nil 40 50 "" '(:function (:declaration (:word "testMethod") (:list) (:word "RelativeType"))))) + (with-temp-buffer + (let ((buffer (phpinspect-make-buffer + :buffer (current-buffer) + :-project (phpinspect--make-project :autoload (phpinspect-make-autoloader))))) + (insert "