branch: externals/phps-mode
commit a45b39a87e86f06d2cb3ea4fd2fb99f84fbb5743
Author: Christian Johansson <[email protected]>
Commit: Christian Johansson <[email protected]>
Added two failing indentation tests for concatenated equal assignment and
double arrow multi-line array declaration
---
phps-mode-test-functions.el | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index ae9386b..b8c45ed 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -323,6 +323,12 @@
(should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (0 0)) (5 (0 0)))
(phps-mode-test-hash-to-list (phps-mode-functions-get-lines-indent)))))
(phps-mode-test-with-buffer
+ "<?php\n$variable = array(\n 'random4' =>\n
'hello'\n);\n$variable = true;\n"
+ "Array assignment with double arrow elements on four lines"
+ ;; (message "Tokens: %s" phps-mode-lexer-tokens)
+ (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (2 0)) (5 (0 0)) (6 (0
0))) (phps-mode-test-hash-to-list (phps-mode-functions-get-lines-indent)))))
+
+ (phps-mode-test-with-buffer
"<?php\n$variable = array(\n 'random4');\n$variable = true;\n"
"Array assignment on two lines"
;; (message "Tokens: %s" phps-mode-lexer-tokens)
@@ -335,6 +341,12 @@
(should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (1 0)))
(phps-mode-test-hash-to-list (phps-mode-functions-get-lines-indent)))))
(phps-mode-test-with-buffer
+ "<?php\n$var .=\n 'A line';"
+ "Concatenated equal single-quoted-string on multiple-lines in assignment"
+ ;; (message "Tokens: %s" phps-mode-lexer-tokens)
+ (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)))
(phps-mode-test-hash-to-list (phps-mode-functions-get-lines-indent)))))
+
+ (phps-mode-test-with-buffer
"<?php\n$str = <<<EOD\nExample of string\nspanning multiple lines\nusing
heredoc syntax.\nEOD;\n"
"Multi-line HEREDOC string in assignment"
;; (message "Tokens: %s" phps-mode-lexer-tokens)