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

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

[elpa] externals/phps-mode 2087abd 282/405: Added two failing tests for


From: Stefan Monnier
Subject: [elpa] externals/phps-mode 2087abd 282/405: Added two failing tests for switch indentation
Date: Sat, 13 Jul 2019 10:00:32 -0400 (EDT)

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

    Added two failing tests for switch indentation
---
 phps-mode-test-functions.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index b3959ae..2394a13 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -338,8 +338,15 @@
    (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (2 0)) (5 (2 0)) (6 (1 
0)) (7 (2 0)) (8 (1 0)) (9 (2 0)) (10 (0 0))) (phps-mode-test-hash-to-list 
(phps-mode-functions-get-lines-indent)))))
 
   (phps-mode-test-with-buffer
+   "<?php\nif (true) {\n    switch ($condition):\n        case true:\n         
   echo 'here';\n            echo 'here 2';\n        case false:\n            
echo 'here 4';\n        default:\n            echo 'here 3';\n    endswitch;\n  
  sprintf(__(\n        'Error: %s',\n        $error\n    ));\n}\n"
+   "Alternative switch, case, default with exception after it"
+   (message "Indent: %s" (phps-mode-test-hash-to-list 
(phps-mode-functions-get-lines-indent)))
+   (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (2 0)) (5 (3 0)) (6 (3 
0)) (7 (2 0)) (8 (3 0)) (9 (2 0)) (10 (3 0)) (11 (1 0)) (12 (1 0)) (13 (2 0)) 
(14 (2 0)) (15 (1 0)) (16 (0 0))) (phps-mode-test-hash-to-list 
(phps-mode-functions-get-lines-indent)))))
+
+
+  (phps-mode-test-with-buffer
    "<?php\nif (true) {\n    switch ($condition) {\n        case true:\n        
    echo 'here';\n            echo 'here 2';\n        case false:\n            
echo 'here 4';\n        default:\n            echo 'here 3';\n    }\n    
sprintf(__(\n        'Error: %s',\n        $error\n    ));\n}\n"
-   "Switch, case, default with exception after it"
+   "Curly switch, case, default with exception after it"
    (message "Indent: %s" (phps-mode-test-hash-to-list 
(phps-mode-functions-get-lines-indent)))
    (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (2 0)) (5 (3 0)) (6 (3 
0)) (7 (2 0)) (8 (3 0)) (9 (2 0)) (10 (3 0)) (11 (1 0)) (12 (1 0)) (13 (2 0)) 
(14 (2 0)) (15 (1 0)) (16 (0 0))) (phps-mode-test-hash-to-list 
(phps-mode-functions-get-lines-indent)))))
 



reply via email to

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