[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 3bc2411 317/405: Moved syntax-table tests to
From: |
Stefan Monnier |
Subject: |
[elpa] externals/phps-mode 3bc2411 317/405: Moved syntax-table tests to own file, using local electric-pair-mode in PHPs buffers |
Date: |
Sat, 13 Jul 2019 10:00:40 -0400 (EDT) |
branch: externals/phps-mode
commit 3bc2411bdd2165d263a2d8766e3984ae851cdb90
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Moved syntax-table tests to own file, using local electric-pair-mode in
PHPs buffers
---
Makefile | 8 ++-
README.md | 34 ++++++------
phps-mode-syntax-table.el | 2 +-
phps-mode-test-functions.el | 69 +------------------------
phps-mode-test-syntax-table.el | 115 +++++++++++++++++++++++++++++++++++++++++
5 files changed, 142 insertions(+), 86 deletions(-)
diff --git a/Makefile b/Makefile
index a14ed07..8cedd5f 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ ifdef emacs
endif
EMACS_CMD := $(EMACS) -Q -batch -L .
-EL := phps-mode-flymake.el phps-mode-font-lock.el phps-mode-functions.el
phps-mode-lexer.el phps-mode-map.el phps-mode-semantic.el
phps-mode-syntax-table.el phps-mode-test.el phps-mode-test-functions.el
phps-mode-test-integration.el phps-mode-test-lexer.el phps-mode-test-parser.el
phps-mode.el
+EL := phps-mode-flymake.el phps-mode-font-lock.el phps-mode-functions.el
phps-mode-lexer.el phps-mode-map.el phps-mode-semantic.el
phps-mode-syntax-table.el phps-mode-test.el phps-mode-test-functions.el
phps-mode-test-integration.el phps-mode-test-lexer.el phps-mode-test-parser.el
phps-mode-test-syntax-table.el phps-mode.el
ELC := $(EL:.el=.elc)
.PHONY: clean
@@ -16,7 +16,7 @@ compile:
$(EMACS_CMD) -f batch-byte-compile $(EL)
.PHONY: tests
-tests: test-functions test-lexer test-parser test-integration
+tests: test-functions test-integration test-lexer test-parser test-syntax-table
.PHONY: test-functions
test-functions:
@@ -33,3 +33,7 @@ test-lexer:
.PHONY: test-parser
test-parser:
$(EMACS_CMD) -l phps-mode-test-parser.el
+
+.PHONY: test-syntax-table
+test-syntax-table:
+ $(EMACS_CMD) -l phps-mode-test-syntax-table.el
diff --git a/README.md b/README.md
index f51cab3..230ffc3b 100644
--- a/README.md
+++ b/README.md
@@ -31,44 +31,48 @@ This mode does not require PHP installed on computer
because it has a elisp base
If you have emacs at a customized location prefix the commands with your path,
i.e.
-`export emacs="~/Documents/emacs/src/emacs" && make test-lexer`
+`export emacs="~/Documents/emacs/src/emacs" && make tests`
-### Lexer
+Run all tests with `make tests`.
-Semantic token generation.
+### Functions
+
+Indentations, incremental processes, Imenu-support.
``` bash
-make test-lexer
+make test-functions
```
-### Parser
+## Integration
-Semantic grammar. Not ready yet.
+This should test all other parts in collaboration.
``` bash
-make test-parser
+make test-integration
```
-### Functions
+### Lexer
-Indentations, incremental processes, Imenu-support.
+Semantic token generation.
``` bash
-make test-functions
+make test-lexer
```
-## Integration tests
+### Parser
-This should test all other parts in collaboration.
+Semantic grammar. Not ready yet.
``` bash
-make test-integration
+make test-parser
```
-## All tests
+### Syntax-table
+
+Basic point and region behaviour.
``` bash
-make tests
+make test-syntax-table
```
## Compilation
diff --git a/phps-mode-syntax-table.el b/phps-mode-syntax-table.el
index 23a1413..f278f20 100644
--- a/phps-mode-syntax-table.el
+++ b/phps-mode-syntax-table.el
@@ -112,7 +112,7 @@
;; NOTE: These are required for wrapping region functionality
(transient-mark-mode)
- (electric-pair-mode)
+ (electric-pair-local-mode)
(when (boundp 'electric-pair-pairs)
diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index 139705f..982a9d9 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -777,72 +777,6 @@
)
-(defun phps-mode-test-functions-quote-region ()
- "Test double quotes, single quotes, curly bracket, square bracket, round
bracket, back-quotes on regions."
-
- (phps-mode-test-with-buffer
- "<?php\n$var = abc;"
- "Double quotes 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;"
- "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 ()
"Test (comment-region) and (uncomment-region)."
@@ -876,8 +810,7 @@
(phps-mode-test-functions-get-lines-indent-psr-2)
(phps-mode-test-functions-indent-line)
(phps-mode-test-functions-imenu)
- (phps-mode-test-functions-comment-uncomment-region)
- (phps-mode-test-functions-quote-region))
+ (phps-mode-test-functions-comment-uncomment-region))
(phps-mode-test-functions)
diff --git a/phps-mode-test-syntax-table.el b/phps-mode-test-syntax-table.el
new file mode 100644
index 0000000..f274d58
--- /dev/null
+++ b/phps-mode-test-syntax-table.el
@@ -0,0 +1,115 @@
+;;; phps-mode-test-syntax-table.el --- Tests for syntax-table -*-
lexical-binding: t -*-
+
+;; Copyright (C) 2019 Christian Johansson
+
+;; This file is not part of GNU Emacs.
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Spathoftware Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+
+;;; Commentary:
+
+
+;; Run from terminal make functions-test
+
+
+;;; Code:
+
+
+(autoload 'phps-mode-test-with-buffer "phps-mode-test")
+(autoload 'phps-mode-functions-verbose "phps-mode-functions")
+(autoload 'phps-mode-functions-indent-line "phps-mode-functions")
+(autoload 'phps-mode-functions-get-lines-indent "phps-mode-functions")
+(autoload 'phps-mode-functions-get-imenu "phps-mode-functions")
+(autoload 'phps-mode-test-hash-to-list "phps-mode-test")
+(autoload 'should "ert")
+
+(defun phps-mode-test-syntax-table-quote-region ()
+ "Test double quotes, single quotes, curly bracket, square bracket, round
bracket, back-quotes on regions."
+
+ (phps-mode-test-with-buffer
+ "<?php\n$var = abc;"
+ "Double quotes 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;"
+ "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-syntax-table ()
+ "Run test."
+ (phps-mode-test-syntax-table-quote-region))
+
+(phps-mode-test-syntax-table)
+
+
+(provide 'phps-mode-test-syntax-table)
+
+;;; phps-mode-test-syntax-table.el ends here
- [elpa] externals/phps-mode f2fe751 302/405: More work on trying to get PSR-2 indentation working, (continued)
- [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
- [elpa] externals/phps-mode 7e755e1 303/405: Fixed indentation for argument assignments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode a852669 320/405: Fix bug in syntax colouring, added debug outputs for incremental lexer, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode ad94b0b 319/405: Removed some fixed TODO itemsc, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 2427c7e 318/405: Improved README, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 6d834c1 312/405: Added support for (comment-region) and (uncomment-region), Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b1d2820 309/405: Fixed issue with indentation of square bracket arrays in assignments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 3bc2411 317/405: Moved syntax-table tests to own file, using local electric-pair-mode in PHPs buffers,
Stefan Monnier <=
- [elpa] externals/phps-mode c2b8a16 335/405: Passes new test for concatenated string inside function arguments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b4e416a 336/405: (comment-region) tests working with custom function, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode ad53b6c 330/405: Fixed warning when expected integer was nil, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode c8c5b62 337/405: Made custom functions for (comment-region) and (uncomment-region), Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 7e22fdb 323/405: Added failing incremental indentation test, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode a45b39a 339/405: Added two failing indentation tests for concatenated equal assignment and double arrow multi-line array declaration, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 3e1ff06 332/405: Added integration-tests for syntax colouring and update goals, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode ced201d 322/405: Updated syntax colouring for namespace, class, function and constant names, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 8298a6a 325/405: Colorized strings after namespace separator, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode a30e5ff 331/405: Run incremental lexer when processing file if buffer change, Stefan Monnier, 2019/07/13