[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode b5c64c1 162/405: Added failing tests for HERE
From: |
Stefan Monnier |
Subject: |
[elpa] externals/phps-mode b5c64c1 162/405: Added failing tests for HEREDOC and NOWDOC assignments |
Date: |
Sat, 13 Jul 2019 10:00:05 -0400 (EDT) |
branch: externals/phps-mode
commit b5c64c195f647d81859f33613d2830c5f245fe4e
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Added failing tests for HEREDOC and NOWDOC assignments
---
phps-mode-functions.el | 3 ++-
phps-mode-test-functions.el | 23 +++++++++++++++++++++--
2 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/phps-mode-functions.el b/phps-mode-functions.el
index eba2a3f..37d38ab 100644
--- a/phps-mode-functions.el
+++ b/phps-mode-functions.el
@@ -129,9 +129,10 @@
(puthash last-line-number `(,column-level ,tuning-level)
line-indents))
(when (> token-end-line-number token-start-line-number)
- ;; (message "Token %s starts at %s and ends at %s" token
token-start-line-number token-end-line-number)
+ (message "Token %s starts at %s and ends at %s" token
token-start-line-number token-end-line-number)
(when (equal token 'T_DOC_COMMENT)
(setq tuning-level 1))
+
(let ((token-line-number-diff (1- (-
token-end-line-number token-start-line-number))))
(while (>= token-line-number-diff 0)
(puthash (- token-end-line-number
token-line-number-diff) `(,column-level ,tuning-level) line-indents)
diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index 476869a..d0d6d5d 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -89,12 +89,31 @@
;; (message "Tokens: %s" phps-mode-lexer-tokens)
(should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (1 0)) (5 (1 0)) (6 (1
0)) (7 (1 0)) (8 (1 0))) (phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
+ (phps-mode-test-with-buffer
+ "<?php\n$str = <<<'EOD'\nExample of string\nspanning multiple lines\nusing
nowdoc syntax.\nEOD;\n"
+ "Multi-line NOWDOC string"
+ (message "Tokens: %s" phps-mode-lexer-tokens)
+ (should (equal '((1 (0 0)) (2 (0 0)) (3 (0 0)) (4 (0 0)) (5 (0 0)) (6 (0
0))) (phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
+
+ (phps-mode-test-with-buffer
+ "<?php\n$str = <<<EOD\nExample of string\nspanning multiple lines\nusing
heredoc syntax.\nEOD;\n"
+ "Multi-line HEREDOC string"
+ (message "Tokens: %s" phps-mode-lexer-tokens)
+ (should (equal '((1 (0 0)) (2 (0 0)) (3 (0 0)) (4 (0 0)) (5 (0 0)) (6 (0
0))) (phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
;; TODO NOWDOC
- ;; TODO HEREDOC
+(phps-mode-test-with-buffer
+ "<?php\n$var = \"A line\nmore text here\nlast line here\";"
+ "Multi-line double-quoted string"
+ (message "Tokens: %s" phps-mode-lexer-tokens)
+ (should (equal '((1 (0 0)) (2 (0 0)) (3 (0 0)) (4 (0 0)))
(phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
- ;; TODO Multi-line single-quoted string
+ (phps-mode-test-with-buffer
+ "<?php\n$var = 'A line\nmore text here\nlast line here';"
+ "Multi-line single-quoted string"
+ (message "Tokens: %s" phps-mode-lexer-tokens)
+ (should (equal '((1 (0 0)) (2 (0 0)) (3 (0 0)) (4 (0 0)))
(phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
;; TODO Multi-line double-quoted strings
- [elpa] externals/phps-mode 321803a 182/405: Line indents are now cleaning on buffer changes, (continued)
- [elpa] externals/phps-mode 321803a 182/405: Line indents are now cleaning on buffer changes, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 38bcabb 176/405: Improved detection of assignment ends in function optional arguments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f1236e2 169/405: Unit tests for indentation calculation for multi-line strings passes, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 105fece 149/405: New indent calculation for inline syntax passes test, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 0a32b17 161/405: Improved calculation for indentation for multi-line assignments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b2eac4d 154/405: More work on switch case default, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 6b5a5c3 155/405: More work on calculating indentations, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode ce2d4bd 148/405: New indentation calculation function passes alternative, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 3718931 156/405: Basic tests for indentation calculation passes, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 13e9148 159/405: Indentation unit test for assignment is passing, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b5c64c1 162/405: Added failing tests for HEREDOC and NOWDOC assignments,
Stefan Monnier <=
- [elpa] externals/phps-mode f283e4b 173/405: Added new failing unit tests for multiple-lines IF and single line class declaration, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 59474ea 180/405: Improved debugging messages, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 9659ab4 174/405: Added failing test for doc-comments are namespace and class, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode c5d8ec6 168/405: Indentation calculation for class implement working, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f93765d 184/405: Improved code structure of indentation were nesting start and end equals, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 2af8abd 206/405: Made TODO notes in algorithm, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 7a538ac 200/405: Tests for alternative control structures passes, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 79e61f4 171/405: Fixed indentation with assignment lines on only one line, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode d18fddc 175/405: Fixed bug with indentation for indented doc-comments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 00c0ab9 194/405: Nesting-stack algorithm handles class declaration indents, Stefan Monnier, 2019/07/13