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

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

[elpa] externals/phps-mode bf59f0a 023/405: More unit tests for getting


From: Stefan Monnier
Subject: [elpa] externals/phps-mode bf59f0a 023/405: More unit tests for getting point lex information
Date: Sat, 13 Jul 2019 09:59:32 -0400 (EDT)

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

    More unit tests for getting point lex information
---
 phps-test-lexer.el | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/phps-test-lexer.el b/phps-test-lexer.el
index 3b3059f..2e6d918 100644
--- a/phps-test-lexer.el
+++ b/phps-test-lexer.el
@@ -252,6 +252,36 @@
    (goto-char 15)
    (should (equal (list nil 0 0 0) (phps-mode/lexer-get-point-data))))
 
+  (phps-mode/with-test-buffer
+   "<html><head><title><?php echo $title; ?></title><body>Bla 
bla</body></html>"
+   (goto-char 30)
+   (should (equal (list t 0 0 0) (phps-mode/lexer-get-point-data))))
+
+  (phps-mode/with-test-buffer
+   "<html><head><title><?php echo $title; ?></title><body>Bla 
bla</body></html>"
+   (goto-char 50)
+   (should (equal (list nil 0 0 0) (phps-mode/lexer-get-point-data))))
+
+  (phps-mode/with-test-buffer
+   "<html><head><title><?php if ($myCondition) { if ($mySeconCondition) { echo 
$title; } } ?></title><body>Bla bla</body></html>"
+   (goto-char 60)
+   (should (equal (list t 1 1 0) (phps-mode/lexer-get-point-data))))
+
+  (phps-mode/with-test-buffer
+   "<html><head><title><?php if ($myCondition) { if ($mySeconCondition) { echo 
$title; } } ?></title><body>Bla bla</body></html>"
+   (goto-char 70)
+   (should (equal (list t 2 0 0) (phps-mode/lexer-get-point-data))))
+
+  (phps-mode/with-test-buffer
+   "<html><head><title><?php if ($myCondition) { if ($mySeconCondition) { echo 
$title; } } ?></title><body>Bla bla</body></html>"
+   (goto-char 85)
+   (should (equal (list t 1 0 0) (phps-mode/lexer-get-point-data))))
+
+  (phps-mode/with-test-buffer
+   "<html><head><title><?php if ($myCondition) { if ($mySeconCondition) { echo 
$title; } } ?></title><body>Bla bla</body></html>"
+   (goto-char 100)
+   (should (equal (list nil 0 0 0) (phps-mode/lexer-get-point-data))))
+
   )
 
 (defun phps-mode/test-lexer ()



reply via email to

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