summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJoão Távora <joaotavora@gmail.com>2014-04-07 00:09:19 +0100
committerJoão Távora <joaotavora@gmail.com>2014-04-07 00:09:19 +0100
commit89f20f76d8fa700d2a534834bf178ac8796d35cf (patch)
tree8b3a2f1a6bd427320ddb303d69a25dfb87ba5b8a /test
parentaa5ccb01a59901cb15a25995b70a7f49d2b03b57 (diff)
downloademacs-89f20f76d8fa700d2a534834bf178ac8796d35cf.tar.gz
Fix electric-pair-skip-whitespace with quotes in text-mode
* lisp/elec-pair.el (electric-pair-post-self-insert-function): Don't skip whitespace for quote syntax when `electric-pair-text-pairs' and `electric-pair-pairs' were used. * test/automated/electric-tests.el (electric-pair-define-test-form): More readable test docstrings. (whitespace-skipping-for-quotes-not-ouside) (whitespace-skipping-for-quotes-only-inside) (whitespace-skipping-not-without-proper-syntax): Fixes: debbugs:17183
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog8
-rw-r--r--test/automated/electric-tests.el29
2 files changed, 35 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 5e5a8ae73af..846da9621fc 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,11 @@
+2014-04-06 João Távora <joaotavora@gmail.com>
+
+ * automated/electric-tests.el (electric-pair-define-test-form):
+ More readable test docstrings.
+ (whitespace-skipping-for-quotes-not-ouside)
+ (whitespace-skipping-for-quotes-only-inside)
+ (whitespace-skipping-for-quotes-in-text-mode): New tests.
+
2014-03-24 Barry O'Reilly <gundaetiapo@gmail.com>
* automated/undo-tests.el (undo-test-marker-adjustment-nominal):
diff --git a/test/automated/electric-tests.el b/test/automated/electric-tests.el
index e3ffd1abd2e..184a91f5105 100644
--- a/test/automated/electric-tests.el
+++ b/test/automated/electric-tests.el
@@ -114,8 +114,8 @@
mode
extra-desc))
()
- ,(format "With \"%s\", try input %c at point %d. \
-Should %s \"%s\" and point at %d"
+ ,(format "With |%s|, try input %c at point %d. \
+Should %s |%s| and point at %d"
fixture
char
(1+ pos)
@@ -341,6 +341,31 @@ Should %s \"%s\" and point at %d"
:test-in-code nil
:test-in-comments t)
+(define-electric-pair-test whitespace-skipping-for-quotes-not-ouside
+ " \" \"" "\"-----" :expected-string "\"\" \" \""
+ :expected-point 2
+ :bindings '((electric-pair-skip-whitespace . chomp))
+ :test-in-strings nil
+ :test-in-code t
+ :test-in-comments nil)
+
+(define-electric-pair-test whitespace-skipping-for-quotes-only-inside
+ " \" \"" "---\"--" :expected-string " \"\""
+ :expected-point 5
+ :bindings '((electric-pair-skip-whitespace . chomp))
+ :test-in-strings nil
+ :test-in-code t
+ :test-in-comments nil)
+
+(define-electric-pair-test whitespace-skipping-quotes-not-without-proper-syntax
+ " \" \"" "---\"--" :expected-string " \"\"\" \""
+ :expected-point 5
+ :modes '(text-mode)
+ :bindings '((electric-pair-skip-whitespace . chomp))
+ :test-in-strings nil
+ :test-in-code t
+ :test-in-comments nil)
+
;;; Pairing arbitrary characters
;;;