branch: externals/phps-mode
commit bf59f0aab3ef7bad1916dae6efb753c764aa1df4
Author: Christian Johansson <[email protected]>
Commit: Christian Johansson <[email protected]>
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 ()