branch: externals/phps-mode commit 8c919ac9efc191ddf1b34a868c65eca158cc64ee Author: Christian Johansson <christ...@cvj.se> Commit: Christian Johansson <christ...@cvj.se>
Added failing indentation test --- README.md | 11 ++++++++++- phps-test-functions.el | 8 ++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dcfe3b5..9ed7f01 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,14 @@ With current progress estimates: * Lexer based on official PHP re2c lexer (100%) * Syntax coloring based on lexer tokens (100%) * PSR based indentation based on lexer tokens (90%) +* Incremental lexer and syntax coloring after buffer changes (75%) * Wisent LALR parser based on official PHP yacc parser automatically converted (60%) -* Incremental lexer and syntax coloring after buffer changes (50%) * Full integration with Emacs Semantic subsystem (30%) * Flymake support (0%) * PSR-2 auto-formatting tool based on lexer tokens (0%) * Add to MELPA (0%) * Add to ELPA (0%) +* Travis support (0%) ## Unit tests @@ -44,6 +45,14 @@ make test-parser make test-functions ``` +### Integration tests + +Not working yet + +``` bash +make test-integration +``` + ### All tests ``` bash diff --git a/phps-test-functions.el b/phps-test-functions.el index f348e4d..cd7711a 100644 --- a/phps-test-functions.el +++ b/phps-test-functions.el @@ -145,6 +145,14 @@ (let ((buffer-contents (buffer-substring-no-properties (point-min) (point-max)))) (should (equal buffer-contents "<?php\nif (empty(\n$this->var\n) && !empty($this->var)\n) {\n$this->var = 'abc123';\n}\n")))) + (phps-mode/with-test-buffer + "<?php\nif (myFirstCondition()) {\n $this->var = 'abc123';\n } else {\n $this->var = 'def456';\n}\n" + (goto-char 68) + (phps-mode/indent-line) + ;; (message "Tokens %s point %s" phps-mode/lexer-tokens (point)) + (let ((buffer-contents (buffer-substring-no-properties (point-min) (point-max)))) + (should (equal buffer-contents "<?php\nif (myFirstCondition()) {\n $this->var = 'abc123';\n} else {\n $this->var = 'def456';\n}\n")))) + )