branch: externals/phps-mode commit 6105e5d65170bf88d6fd8a5dbef0a088183a1cf6 Author: Christian Johansson <christ...@cvj.se> Commit: Christian Johansson <christ...@cvj.se>
Added a new failing test for indetation --- phps-mode-test-functions.el | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el index 6dbb63c..d284e7e 100644 --- a/phps-mode-test-functions.el +++ b/phps-mode-test-functions.el @@ -89,24 +89,48 @@ (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (1 0))) (phps-mode-test-functions--hash-to-list (phps-mode-functions-get-lines-indent))))) (phps-mode-test-with-buffer + "<?php\necho myFunction(\"A line\" .\n \"more text here\" .\n \"last line here\");" + "Concatenated double-quoted-string spanning multiple-lines inside function" + ;; (message "Tokens: %s" phps-mode-lexer-tokens) + (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (1 0))) (phps-mode-test-functions--hash-to-list (phps-mode-functions-get-lines-indent))))) + + (phps-mode-test-with-buffer "<?php\necho \"A line\"\n . \"more text here\"\n . \"last line here\";" "Concatenated double-quoted-string spanning multiple-lines 2" ;; (message "Tokens: %s" phps-mode-lexer-tokens) (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (1 0))) (phps-mode-test-functions--hash-to-list (phps-mode-functions-get-lines-indent))))) (phps-mode-test-with-buffer + "<?php\necho myFunction(\"A line\" .\n \"more text here\" .\n \"last line here\");" + "Concatenated double-quoted-string spanning multiple-lines inside function 2" + ;; (message "Tokens: %s" phps-mode-lexer-tokens) + (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (1 0))) (phps-mode-test-functions--hash-to-list (phps-mode-functions-get-lines-indent))))) + + (phps-mode-test-with-buffer "<?php\necho 'A line' .\n 'more text here' .\n 'last line here';" "Concatenated single-quoted-string spanning multiple-lines" ;; (message "Tokens: %s" phps-mode-lexer-tokens) (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (1 0))) (phps-mode-test-functions--hash-to-list (phps-mode-functions-get-lines-indent))))) (phps-mode-test-with-buffer + "<?php\necho myFunction('A line' .\n 'more text here' .\n 'last line here');" + "Concatenated single-quoted-string spanning multiple-lines inside function" + ;; (message "Tokens: %s" phps-mode-lexer-tokens) + (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (1 0))) (phps-mode-test-functions--hash-to-list (phps-mode-functions-get-lines-indent))))) + + (phps-mode-test-with-buffer "<?php\necho 'A line'\n . 'more text here'\n . 'last line here';" "Concatenated single-quoted-string spanning multiple-lines 2" ;; (message "Tokens: %s" phps-mode-lexer-tokens) (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (1 0))) (phps-mode-test-functions--hash-to-list (phps-mode-functions-get-lines-indent))))) (phps-mode-test-with-buffer + "<?php\necho myFunction('A line'\n . 'more text here'\n . 'last line here');" + "Concatenated single-quoted-string spanning multiple-lines inside function 2" + ;; (message "Tokens: %s" phps-mode-lexer-tokens) + (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (1 0))) (phps-mode-test-functions--hash-to-list (phps-mode-functions-get-lines-indent))))) + + (phps-mode-test-with-buffer "<?php\necho <<<EOD\nExample of string\nspanning multiple lines\nusing heredoc syntax.\nEOD;\n" "Multi-line HEREDOC string outside assignment" ;; (message "Tokens: %s" phps-mode-lexer-tokens) @@ -559,7 +583,7 @@ (defun phps-mode-test-functions () "Run test for functions." ;; (setq debug-on-error t) - ;; (setq phps-mode-functions-verbose t) + (setq phps-mode-functions-verbose t) (phps-mode-test-functions-get-lines-lindent-if) (phps-mode-test-function-get-lines-indent-classes) (phps-mode-test-functions-get-lines-indent-inline-if)