[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode b251a1e 314/405: Got unit tests for wrapping
From: |
Stefan Monnier |
Subject: |
[elpa] externals/phps-mode b251a1e 314/405: Got unit tests for wrapping region in symbols working |
Date: |
Sat, 13 Jul 2019 10:00:39 -0400 (EDT) |
branch: externals/phps-mode
commit b251a1ebc4e13ecb52cb9fb2cb531c8db43fe072
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Got unit tests for wrapping region in symbols working
---
phps-mode-test-functions.el | 61 ++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 57 insertions(+), 4 deletions(-)
diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index d1241a8..c4895ad 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -780,18 +780,71 @@
(defun phps-mode-test-functions-quote-region ()
"Test double quotes, single quotes, curly bracket, square bracket, round
bracket, back-quotes on regions."
+ ;; NOTE: These are required for wrapping region functionality
+ (transient-mark-mode)
+ (electric-pair-mode)
- ;; TODO Implement this
(phps-mode-test-with-buffer
"<?php\n$var = abc;"
- "Double quotes around letters"
+ "Double quotes around region"
(goto-char 14)
- (set-mark (point))
- (forward-char 3)
+ (push-mark nil t t)
+ (goto-char 17)
(execute-kbd-macro (kbd "\""))
(let ((buffer-contents (buffer-substring-no-properties (point-min)
(point-max))))
(should (equal buffer-contents "<?php\n$var = \"abc\";"))))
+ (phps-mode-test-with-buffer
+ "<?php\n$var = abc;"
+ "Single-quotes brackets around region"
+ (goto-char 14)
+ (push-mark nil t t)
+ (goto-char 17)
+ (execute-kbd-macro (kbd "'"))
+ (let ((buffer-contents (buffer-substring-no-properties (point-min)
(point-max))))
+ (should (equal buffer-contents "<?php\n$var = 'abc';"))))
+
+ (phps-mode-test-with-buffer
+ "<?php\n$var = abc;"
+ "Round brackets around region"
+ (goto-char 14)
+ (push-mark nil t t)
+ (goto-char 17)
+ (execute-kbd-macro (kbd "("))
+ (let ((buffer-contents (buffer-substring-no-properties (point-min)
(point-max))))
+ (should (equal buffer-contents "<?php\n$var = (abc);"))))
+
+ (phps-mode-test-with-buffer
+ "<?php\n$var = abc;"
+ "Square brackets around region"
+ (goto-char 14)
+ (push-mark nil t t)
+ (goto-char 17)
+ (execute-kbd-macro (kbd "["))
+ (let ((buffer-contents (buffer-substring-no-properties (point-min)
(point-max))))
+ (should (equal buffer-contents "<?php\n$var = [abc];"))))
+
+ (phps-mode-test-with-buffer
+ "<?php\n$var = abc;"
+ "Curly brackets around region"
+ (goto-char 14)
+ (push-mark nil t t)
+ (goto-char 17)
+ (execute-kbd-macro (kbd "{"))
+ (let ((buffer-contents (buffer-substring-no-properties (point-min)
(point-max))))
+ (should (equal buffer-contents "<?php\n$var = {abc};"))))
+
+ (phps-mode-test-with-buffer
+ "<?php\n$var = abc;"
+ "Backquotes brackets around region"
+ (goto-char 14)
+ (push-mark nil t t)
+ (goto-char 17)
+ (execute-kbd-macro (kbd "`"))
+ (let ((buffer-contents (buffer-substring-no-properties (point-min)
(point-max))))
+ (should (equal buffer-contents "<?php\n$var = `abc`;"))))
+
+
)
(defun phps-mode-test-functions-comment-uncomment-region ()
- [elpa] externals/phps-mode 2087abd 282/405: Added two failing tests for switch indentation, (continued)
- [elpa] externals/phps-mode 2087abd 282/405: Added two failing tests for switch indentation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 43c13b4 295/405: Started on new algorithm for concatenation indentation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b2ff76e 283/405: Started on debugging switch indentation bug, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 1aadb1b 285/405: Added failing lexer test for comment vs doc-comment, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 95de04b 274/405: New layout for lexer grammar passes unit tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 00d3568 290/405: Added indentation examples from official PSR-2, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode ec3fd41 289/405: Added failing indent test for mixed concatenation and function call, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode cc77604 284/405: Fixed bug with indentation after switch case statements, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode eeffdb2 315/405: Fixed trailing white-space, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 02b69f5 304/405: Tests for PSR-2 now passes with new algorithms, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b251a1e 314/405: Got unit tests for wrapping region in symbols working,
Stefan Monnier <=
- [elpa] externals/phps-mode 20199b0 307/405: Added byte-compiled Lisp to gitignore, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode a0b7695 316/405: Passes unit tests for integration with electric-pair, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 7c3a31a 305/405: Fixed bug in indentation with stacked assignment closures, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 68422f5 301/405: Restored indentation test for PSR-2 closure, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f3766db 310/405: Fixed byte-compilation in lexer and integration-tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 2ec6f6d 306/405: Fixed some compilation warnings, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f2fe751 302/405: More work on trying to get PSR-2 indentation working, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 8eb3dc0 311/405: Fixed byte-compilation issue in lexer, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f77edf8 308/405: Updated compile command to ignore that files that doesn't compile, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 5d5ec06 313/405: Started on test for automatic quotations, Stefan Monnier, 2019/07/13