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

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

[elpa] externals/phps-mode e206605 115/405: Adding failing unit tests fo


From: Stefan Monnier
Subject: [elpa] externals/phps-mode e206605 115/405: Adding failing unit tests for inline and alternative syntax
Date: Sat, 13 Jul 2019 09:59:55 -0400 (EDT)

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

    Adding failing unit tests for inline and alternative syntax
---
 phps-mode-test-functions.el | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index 19f95a8..a0cef01 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -333,6 +333,50 @@
    (goto-char 46)
    (should (equal (list (list t 0 0 2 0 0 6 nil) (list t 0 0 2 0 0 8 nil)) 
(phps-mode-functions-get-point-data))))
 
+  ;; INLINE SYNTAX
+
+  (phps-mode-test-with-buffer
+   "<?php\nif ($myCondition)\n    echo 'was here';\necho 'was here 2';\n"
+   (goto-char 41)
+   (should (equal (list (list t 0 0 0 1 0 4 nil) (list t 0 0 0 0 0 8 nil)) 
(phps-mode-functions-get-point-data))))
+
+  (phps-mode-test-with-buffer
+   "<?php\nif ($myCondition)\n    echo 'was here';\necho 'was here 2';\n"
+   (goto-char 60)
+   (should (equal (list (list t 0 0 0 0 0 4 nil) (list t 0 0 0 0 0 8 nil)) 
(phps-mode-functions-get-point-data))))
+
+  (phps-mode-test-with-buffer
+   "<?php\nif ($myCondition) echo 'was here'; echo 'was here 2';\n"
+   (goto-char 32)
+   (should (equal (list (list t 0 0 0 1 0 4 nil) (list t 0 0 0 0 0 8 nil)) 
(phps-mode-functions-get-point-data))))
+
+  (phps-mode-test-with-buffer
+   "<?php\nif ($myCondition) echo 'was here'; echo 'was here 2';\n"
+   (goto-char 55)
+   (should (equal (list (list t 0 0 0 0 0 4 nil) (list t 0 0 0 0 0 8 nil)) 
(phps-mode-functions-get-point-data))))
+
+  ;; TODO ALTERNATIVE SYNTAX
+
+  (phps-mode-test-with-buffer
+   "<?php\nif ($myCondition):\n    echo 'was here';\nendif;\necho 'was here 
2';\n"
+   (goto-char 41)
+   (should (equal (list (list t 0 0 0 0 1 4 nil) (list t 0 0 0 0 0 8 nil)) 
(phps-mode-functions-get-point-data))))
+
+  (phps-mode-test-with-buffer
+   "<?php\nif ($myCondition):\n    echo 'was here';\nendif;\necho 'was here 
2';\n"
+   (goto-char 52)
+   (should (equal (list (list t 0 0 0 0 0 4 nil) (list t 0 0 0 0 0 8 nil)) 
(phps-mode-functions-get-point-data))))
+
+  (phps-mode-test-with-buffer
+   "<?php\nif ($myCondition):    echo 'was here';\nendif;\necho 'was here 
2';\n"
+   (goto-char 32)
+   (should (equal (list (list t 0 0 0 1 0 4 nil) (list t 0 0 0 0 0 8 nil)) 
(phps-mode-functions-get-point-data))))
+
+  (phps-mode-test-with-buffer
+   "<?php\nif ($myCondition): echo 'was here'; endif; echo 'was here 2';\n"
+   (goto-char 35)
+   (should (equal (list (list t 0 0 0 0 1 4 nil) (list t 0 0 0 0 0 8 nil)) 
(phps-mode-functions-get-point-data))))
+  
   )
 
 ;; TODO Add tests for all examples here: https://www.php-fig.org/psr/psr-2/



reply via email to

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