emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/phps-mode ec3fd41 289/405: Added failing indent test fo


From: Stefan Monnier
Subject: [elpa] externals/phps-mode ec3fd41 289/405: Added failing indent test for mixed concatenation and function call
Date: Sat, 13 Jul 2019 10:00:34 -0400 (EDT)

branch: externals/phps-mode
commit ec3fd41b443dce03d7c90c71744001a3ea59ab0a
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>

    Added failing indent test for mixed concatenation and function call
---
 phps-mode-test-functions.el | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index 6a26ee5..c0c63be 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -49,8 +49,6 @@
    "Round and square bracket expressions"
    (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (1 0)) (5 (2 0)) (6 (1 
0)) (7 (1 0)) (8 (0 0))) (phps-mode-test-hash-to-list 
(phps-mode-functions-get-lines-indent)))))
 
-  ;; TODO Test <?php\necho 'blaha'\n    . 'ijeije' . __(\n        'okeoke'\n   
 )\n    'okeoke';\n?>
-
   (phps-mode-test-with-buffer
    "<?php\nvar_dump(array(<<<EOD\nfoobar!\nEOD\n));\n?>"
    "HEREDOC in arguments example"
@@ -158,6 +156,24 @@
    "Do while loop with multi-line condition"
    (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (0 0)) (5 (1 0)) (6 (0 
0))) (phps-mode-test-hash-to-list (phps-mode-functions-get-lines-indent)))))
 
+  (phps-mode-test-with-buffer
+   "<?php\ndo {\n    echo 'true';\n} while ($number > 0\n    && $letter > 
0\n);"
+   "Do while loop with multi-line condition"
+   (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (0 0)) (5 (1 0)) (6 (0 
0))) (phps-mode-test-hash-to-list (phps-mode-functions-get-lines-indent)))))
+
+  (phps-mode-test-with-buffer
+   "<?php\n$myVar = 'blaha'\n    . 'ijeije' . __(\n        'okeoke'\n    )\n   
 . 'okeoke';\n?>"
+   "Concatenated assignment string with function call"
+   (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (2 0)) (5 (1 0)) (6 (1 
0)) (7 (0 0))) (phps-mode-test-hash-to-list 
(phps-mode-functions-get-lines-indent)))))
+
+  (phps-mode-test-with-buffer
+   "<?php\necho 'blaha'\n    . 'ijeije' . __(\n        'okeoke'\n    )\n    . 
'okeoke';\n?>"
+   "Concatenated echo string with function call"
+   (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (2 0)) (5 (1 0)) (6 (1 
0)) (7 (0 0))) (phps-mode-test-hash-to-list 
(phps-mode-functions-get-lines-indent)))))
+
+
+  ;; TODO Add tests for all examples here: https://www.php-fig.org/psr/psr-2/
+
   )
 
 (defun phps-mode-test-functions-get-lines-indent-multi-line-assignments ()
@@ -629,12 +645,10 @@
 
   )
 
-;; TODO Add tests for all examples here: https://www.php-fig.org/psr/psr-2/
-
 (defun phps-mode-test-functions ()
   "Run test for functions."
   ;; (setq debug-on-error t)
-  ;; (setq phps-mode-functions-verbose t)
+  (setq phps-mode-functions-verbose t)
   (phps-mode-test-functions-get-lines-lindent-if)
   (phps-mode-test-functions-get-lines-indent-classes)
   (phps-mode-test-functions-get-lines-indent-inline-if)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]