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

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

[elpa] externals/phps-mode 6c8eea0 100/405: Added another failing indent


From: Stefan Monnier
Subject: [elpa] externals/phps-mode 6c8eea0 100/405: Added another failing indentation case for switch case
Date: Sat, 13 Jul 2019 09:59:52 -0400 (EDT)

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

    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

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