[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 5c0568b 033/405: Added some basic unit tests
From: |
Stefan Monnier |
Subject: |
[elpa] externals/phps-mode 5c0568b 033/405: Added some basic unit tests for indentation |
Date: |
Sat, 13 Jul 2019 09:59:34 -0400 (EDT) |
branch: externals/phps-mode
commit 5c0568bac426fb2724a7741293f9040c1fdb431d
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Added some basic unit tests for indentation
---
phps-test-functions.el | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/phps-test-functions.el b/phps-test-functions.el
index c25f820..891c541 100644
--- a/phps-test-functions.el
+++ b/phps-test-functions.el
@@ -42,6 +42,7 @@
(defun phps-mode/test-indentation ()
"Test for indentation."
+
(phps-mode/with-test-buffer
"<html><head><title><?php if ($myCondition) {\nif ($mySeconCondition)
{\necho $title;\n\n} ?></title><body>Bla bla</body></html>"
(goto-char 69)
@@ -50,23 +51,28 @@
(should (equal buffer-contents "<html><head><title><?php if
($myCondition) {\n if ($mySeconCondition) {\necho $title;\n\n}
?></title><body>Bla bla</body></html>"))))
(phps-mode/with-test-buffer
- "<html><head><title><?php if ($myCondition) {\nif ($mySeconCondition)
{\necho $title;\n\n} ?></title><body>Bla bla</body></html>"
- (goto-char 80)
+ "<html><head><title><?php if ($myCondition) {\nif ($mySeconCondition)
{\necho $title;\n} ?></title><body>Bla bla</body></html>"
+
+ (goto-char 75)
(phps-mode/indent-line)
(let ((buffer-contents (buffer-substring-no-properties (point-min)
(point-max))))
- (should (equal buffer-contents "<html><head><title><?php if
($myCondition) {\nif ($mySeconCondition) {\n echo $title;\n\n}
?></title><body>Bla bla</body></html>"))))
+ (should (equal buffer-contents "<html><head><title><?php if
($myCondition) {\nif ($mySeconCondition) {\n echo $title;\n}
?></title><body>Bla bla</body></html>"))))
(phps-mode/with-test-buffer
"<html><head><title><?php if ($myCondition) {\nif ($mySeconCondition)
{\necho $title;\n\n} ?></title><body>Bla bla</body></html>"
+
(goto-char 98)
(phps-mode/indent-line)
(let ((buffer-contents (buffer-substring-no-properties (point-min)
(point-max))))
- (should (equal buffer-contents "<html><head><title><?php if
($myCondition) {\nif ($mySeconCondition) {\necho $title;\n\n}
?></title><body>Bla bla</body></html>"))))
+ (should (equal buffer-contents "<html><head><title><?php if
($myCondition) {\nif ($mySeconCondition) {\necho $title;\n\n }
?></title><body>Bla bla</body></html>"))))
)
(defun phps-mod/test-functions ()
"Run test for functions."
+ (setq-default indent-tabs-mode nil)
+ (setq-default tab-width 4)
+ (setq-default c-basic-indent 4)
(phps-mode/test-indentation))
(phps-mod/test-functions)
- [elpa] externals/phps-mode 3202213 025/405: Added another unit test for lexer, (continued)
- [elpa] externals/phps-mode 3202213 025/405: Added another unit test for lexer, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode bf59f0a 023/405: More unit tests for getting point lex information, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode de771b5 019/405: Added more unit tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode e3a060a 026/405: Handles script breaking single-line comments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 7fa9fdb 024/405: More unit tests for lexing comments and doc comments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 64a3ca8 014/405: Modified start and end for single and double quoted strings, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 3ea8c64 003/405: Added license, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f6e3ce4 027/405: Added another test for comments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 4fa9341 030/405: Started with unit tests for indentation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 184dfa5 034/405: Indentation outside PHP now does nothing, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 5c0568b 033/405: Added some basic unit tests for indentation,
Stefan Monnier <=
- [elpa] externals/phps-mode 47440dd 036/405: Added test for decreasing indentation with letters, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 9d3f644 032/405: Separated indentation tests for lexer tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode d839f8a 029/405: More work on indentation support, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode efcefde 035/405: Added support for closing parenthesis and braces, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 1b891ea 031/405: More work on indentation and related tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode c6e5255 038/405: Merge branch 'master' of https://github.com/cjohansson/emacs-phps-mode, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 3837d9c 001/405: My initial commit, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 6776468 037/405: Started worked with adding references to tokens from point meta information, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode feb5724 039/405: Various debug work, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode e36d477 045/405: token-number from point now is the same format as (nth), Stefan Monnier, 2019/07/13