[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phpinspect 3fff772d8a 03/18: Fix phpinspect-buffer-inde
From: |
ELPA Syncer |
Subject: |
[elpa] externals/phpinspect 3fff772d8a 03/18: Fix phpinspect-buffer-index-functions test |
Date: |
Fri, 16 Aug 2024 06:58:55 -0400 (EDT) |
branch: externals/phpinspect
commit 3fff772d8a1f52ef16c6dfb8a6984e6bc0a5f5ba
Author: Hugo Thunnissen <devel@hugot.nl>
Commit: Hugo Thunnissen <devel@hugot.nl>
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 689e7cb2d4..b846adcdac 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 "<?php
+namespace NS;
- (phpinspect-buffer-index-declarations buffer declarations)
- (phpinspect-buffer-index-namespaces buffer namespaces)
- (phpinspect-buffer-index-classes buffer classes)
+class TestClass
+{
+ function testMethod(): RelativeType {}
+}")
+ (phpinspect-buffer-update-project-index buffer)
- (phpinspect-buffer-index-functions buffer functions)
- (should (phpinspect-project-get-class
- (phpinspect-buffer-project buffer)
- (phpinspect--make-type :name "\\NS\\TestClass")))
+ (should (phpinspect-project-get-class
+ (phpinspect-buffer-project buffer)
+ (phpinspect--make-type :name "\\NS\\TestClass")))
- (should (= 1 (hash-table-count (phpinspect--class-methods
- (phpinspect-project-get-class
- (phpinspect-buffer-project buffer)
- (phpinspect--make-type :name
"\\NS\\TestClass"))))))
+ (should (= 1 (hash-table-count (phpinspect--class-methods
+ (phpinspect-project-get-class
+ (phpinspect-buffer-project buffer)
+ (phpinspect--make-type :name
"\\NS\\TestClass"))))))
- (setf (phpinspect-buffer-map buffer) (phpinspect-make-bmap :-root-meta
(phpinspect-make-meta nil 1 400 "" 'root)))
+ (setf (phpinspect-buffer-map buffer) (phpinspect-make-bmap :-root-meta
(phpinspect-make-meta nil 1 400 "" 'root)))
- (phpinspect-buffer-index-functions buffer (phpinspect-make-splayt))
+ (phpinspect-buffer-index-functions buffer (phpinspect-make-splayt))
- (should (= 0 (hash-table-count (phpinspect--class-methods
- (phpinspect-project-get-class
- (phpinspect-buffer-project buffer)
- (phpinspect--make-type :name
"\\NS\\TestClass"))))))))
+ (should (= 0 (hash-table-count (phpinspect--class-methods
+ (phpinspect-project-get-class
+ (phpinspect-buffer-project buffer)
+ (phpinspect--make-type :name
"\\NS\\TestClass")))))))))
(ert-deftest phpinspect-buffer-index-class-variables ()
(let ((buffer (phpinspect-make-buffer :-project (phpinspect--make-project
:autoload (phpinspect-make-autoloader))))
- [elpa] externals/phpinspect updated (3887bc58d4 -> 4ec4c40c9d), ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect d3f100388e 04/18: Resolve property types using other methods when resolving from constructor fails, ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect 3fff772d8a 03/18: Fix phpinspect-buffer-index-functions test,
ELPA Syncer <=
- [elpa] externals/phpinspect d141f8a6db 08/18: Infer namespace token within import manipulation loop, ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect 8296641ba9 07/18: Implement removal of unused imports in `phpinspect-fix-imports', ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect 93b815d71a 14/18: Index used traits (juste use of type, no actual functionality outside of that), ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect 6a175c9e44 06/18: Update a few doc strings in phpinspect-index.el, ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect 31c6e06934 09/18: Reparse buffer when fixing import (+ add comment explaining why), ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect 2e064d52e1 17/18: Implement containing type inference for collection-like class properties, ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect 5528aff2a2 01/18: Handle cases where the filepath of a type cannot be determined, ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect 2520c89680 02/18: Account for tokens after @method annotation when indexing, ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect f2f1ac9b84 05/18: Add property types and anonymous function argument types to used-types index, ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect 130e2c06c5 13/18: Index types used in arrays, ELPA Syncer, 2024/08/16