[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 7e22fdb 323/405: Added failing incremental in
From: |
Stefan Monnier |
Subject: |
[elpa] externals/phps-mode 7e22fdb 323/405: Added failing incremental indentation test |
Date: |
Sat, 13 Jul 2019 10:00:41 -0400 (EDT) |
branch: externals/phps-mode
commit 7e22fdb6db102aabbbccee4750aebed650d6bcfc
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Added failing incremental indentation test
---
phps-mode-functions.el | 2 +-
phps-mode-test-integration.el | 31 ++++++++++++++++++++++++++++++-
2 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/phps-mode-functions.el b/phps-mode-functions.el
index d902626..d4e1bc0 100644
--- a/phps-mode-functions.el
+++ b/phps-mode-functions.el
@@ -53,7 +53,7 @@
(defun phps-mode-functions-reset-buffer-changes-start ()
"Reset buffer change start."
- (message "Reset flag for buffer changes")
+ ;; (message "Reset flag for buffer changes")
(setq phps-mode-functions-buffer-changes-start nil))
(defun phps-mode-functions-process-current-buffer ()
diff --git a/phps-mode-test-integration.el b/phps-mode-test-integration.el
index a103f74..999679b 100644
--- a/phps-mode-test-integration.el
+++ b/phps-mode-test-integration.el
@@ -66,6 +66,9 @@
;; Run incremental lexer
(phps-mode-lexer-run-incremental)
+ ;; TODO Should maybe change this to a more more simpler way
+ ;; like compare lexer tokens, indent and imenu with same contents in a new
buffer
+
;; Tokens
;; (message "Tokens %s" (phps-mode-lexer-get-tokens))
(should (equal (phps-mode-lexer-get-tokens) '((T_OPEN_TAG 1 . 7)
(T_NAMESPACE 7 . 16) (T_STRING 17 . 28) ("{" 29 . 30) (T_CLASS 35 . 40)
(T_STRING 41 . 48) ("{" 53 . 54) (T_PUBLIC 63 . 69) (T_FUNCTION 70 . 78)
(T_STRING 79 . 89) ("(" 89 . 90) (")" 90 . 91) ("{" 100 . 101) (T_ECHO 114 .
118) (T_CONSTANT_ENCAPSED_STRING 119 . 133) (";" 133 . 134) (";" 133 . 134)
("}" 143 . 144) (T_PUBLIC 154 . 160) (T_FUNCTION 161 . 169) (T_STRING 170 .
181) ("(" 181 . 182) (")" 182 . 183) ("{" 192 . 19 [...]
@@ -75,7 +78,33 @@
(should (equal '((1 (0 0)) (2 (0 0)) (3 (0 0)) (4 (1 0)) (5 (1 0)) (6 (2
0)) (7 (2 0)) (8 (3 0)) (9 (2 0)) (10 (2 0)) (11 (2 0)) (12 (2 0)) (13 (3 0))
(14 (2 0)) (15 (2 0)) (16 (1 0)) (17 (0 0))) (phps-mode-test-hash-to-list
(phps-mode-functions-get-lines-indent))))
;; Imenu
- (should (equal (phps-mode-functions-get-imenu) '(("\\myNamespace" . 17)
("\\myNamespace\\myClass" . 41) ("\\myNamespace\\myClass->myFunction()" . 79)
("\\myNamespace\\myClass->myFunctionB()" . 170)))))
+ (should (equal (phps-mode-functions-get-imenu) '(("\\myNamespace" . 17)
("\\myNamespace\\myClass" . 41) ("\\myNamespace\\myClass->myFunction()" . 79)
("\\myNamespace\\myClass->myFunctionB()" . 170))))
+
+ ;; Remove first function
+ (goto-char 55)
+ (push-mark nil t t)
+ (goto-char 145)
+ (execute-kbd-macro (kbd "<backspace>"))
+
+ ;; Verify stored point of change
+ (should (equal (phps-mode-functions-get-buffer-changes-start) 55))
+
+ ;; Run incremental lexer
+ (phps-mode-lexer-run-incremental)
+
+ ;; Tokens
+ ;; (message "Tokens %s" (phps-mode-lexer-get-tokens))
+ (should (equal (phps-mode-lexer-get-tokens) '((T_OPEN_TAG 1 . 7)
(T_NAMESPACE 7 . 16) (T_STRING 17 . 28) ("{" 29 . 30) (T_CLASS 35 . 40)
(T_STRING 41 . 48) ("{" 53 . 54) ("{" 53 . 54) (T_PUBLIC 64 . 70) (T_FUNCTION
71 . 79) (T_STRING 80 . 91) ("(" 91 . 92) (")" 92 . 93) ("{" 102 . 103) (T_ECHO
116 . 120) (T_CONSTANT_ENCAPSED_STRING 121 . 142) (";" 142 . 143) ("}" 152 .
153) ("}" 159 . 160) ("}" 161 . 162))))
+
+ ;; Imenu
+ (should (equal (phps-mode-functions-get-imenu) '(("\\myNamespace" . 17)
("\\myNamespace\\myClass" . 41) ("\\myNamespace\\myClass->myFunctionB()" . 80)
)))
+
+ ;; Indentation
+ (message "indent: %s" (phps-mode-test-hash-to-list
(phps-mode-functions-get-lines-indent)))
+ (should (equal '((1 (0 0)) (2 (0 0)) (3 (0 0)) (4 (1 0)) (5 (1 0)) (6 (2
0)) (7 (2 0)) (8 (2 0)) (9 (3 0)) (10 (2 0)) (11 (2 0)) (12 (1 0)) (13 (0 0)))
(phps-mode-test-hash-to-list (phps-mode-functions-get-lines-indent))))
+
+
+ )
)
- [elpa] externals/phps-mode a852669 320/405: Fix bug in syntax colouring, added debug outputs for incremental lexer, (continued)
- [elpa] externals/phps-mode a852669 320/405: Fix bug in syntax colouring, added debug outputs for incremental lexer, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode ad94b0b 319/405: Removed some fixed TODO itemsc, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 2427c7e 318/405: Improved README, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 6d834c1 312/405: Added support for (comment-region) and (uncomment-region), Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b1d2820 309/405: Fixed issue with indentation of square bracket arrays in assignments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 3bc2411 317/405: Moved syntax-table tests to own file, using local electric-pair-mode in PHPs buffers, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode c2b8a16 335/405: Passes new test for concatenated string inside function arguments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b4e416a 336/405: (comment-region) tests working with custom function, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode ad53b6c 330/405: Fixed warning when expected integer was nil, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode c8c5b62 337/405: Made custom functions for (comment-region) and (uncomment-region), Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 7e22fdb 323/405: Added failing incremental indentation test,
Stefan Monnier <=
- [elpa] externals/phps-mode a45b39a 339/405: Added two failing indentation tests for concatenated equal assignment and double arrow multi-line array declaration, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 3e1ff06 332/405: Added integration-tests for syntax colouring and update goals, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode ced201d 322/405: Updated syntax colouring for namespace, class, function and constant names, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 8298a6a 325/405: Colorized strings after namespace separator, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode a30e5ff 331/405: Run incremental lexer when processing file if buffer change, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode e9475f7 321/405: Merge branch 'master' of https://github.com/cjohansson/emacs-phps-mode, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 55b3087 333/405: Optimized lexer calling, do not call when using (indent-line), Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode a309998 326/405: Integration tests passes with new function, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode c37b234 334/405: Added failing test for indent in concatenated string inside function arguments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 8109c1a 328/405: (uncomment-region) working, Stefan Monnier, 2019/07/13