branch: externals/phps-mode
commit 6c8eea00691f62f27e2c44cdfb9c45f221e78b54
Author: Christian Johansson <christ...@cvj.se>
Commit: Christian Johansson <christ...@cvj.se>

    Added another failing indentation case for switch case
---
 phps-test-functions.el | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/phps-test-functions.el b/phps-test-functions.el
index 429503c..3d63fe3 100644
--- a/phps-test-functions.el
+++ b/phps-test-functions.el
@@ -179,6 +179,22 @@
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents "<?php\nif (myRandomCondition()):\necho 
'Something here';\nelse:\n    echo 'Something else here';\nendif;\n"))))
 
+  ;; switch case
+  
+  (phps-mode/with-test-buffer
+   "<?php\nswitch (myRandomCondition()) {\ncase 'Something here':\necho 
'Something else here';\n}\n"
+   (goto-char 45)
+   (phps-mode/indent-line)
+   (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
+     (should (equal buffer-contents "<?php\nswitch (myRandomCondition()) {\n   
 case 'Something here':\necho 'Something else here';\n}\n"))))
+
+  (phps-mode/with-test-buffer
+   "<?php\nswitch (myRandomCondition()) {\ncase 'Something here':\necho 
'Something else here';\n}\n"
+   (goto-char 65)
+   (phps-mode/indent-line)
+   (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
+     (should (equal buffer-contents "<?php\nswitch (myRandomCondition()) 
{\ncase 'Something here':\n        echo 'Something else here';\n}\n"))))
+
   (phps-mode/with-test-buffer
    "<?php\nif (myRandomCondition())\necho 'Something here';\necho 'Something 
else here';\n"
    (goto-char 40)

Reply via email to