aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2014-04-08 21:50:29 -0400
committerGlenn Morris2014-04-08 21:50:29 -0400
commit50c9a9b8a871ce281b43a196bd912f3d2fdda5fa (patch)
treec0b2459abdbf5fce686966c9a5d1d0816cb03114
parent3b7fab25046801a0451dbce5ccd65153e02c93f7 (diff)
downloademacs-50c9a9b8a871ce281b43a196bd912f3d2fdda5fa.tar.gz
emacs-50c9a9b8a871ce281b43a196bd912f3d2fdda5fa.zip
Fix python-triple-quote-pairing test
* test/automated/python-tests.el (python-triple-quote-pairing): Enable/disable electric-pair-mode as needed.
-rw-r--r--test/ChangeLog3
-rw-r--r--test/automated/python-tests.el54
2 files changed, 33 insertions, 24 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index cca4a247e39..8b9b507d1c7 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,5 +1,8 @@
12014-04-09 Glenn Morris <rgm@gnu.org> 12014-04-09 Glenn Morris <rgm@gnu.org>
2 2
3 * automated/python-tests.el (python-triple-quote-pairing):
4 Enable/disable electric-pair-mode as needed.
5
3 * automated/electric-tests.el (electric-pair-backspace-1): 6 * automated/electric-tests.el (electric-pair-backspace-1):
4 Replace deleted function. 7 Replace deleted function.
5 8
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el
index 8fe8f71264f..de963a670bc 100644
--- a/test/automated/python-tests.el
+++ b/test/automated/python-tests.el
@@ -2722,30 +2722,36 @@ def foo(a, b, c):
2722 (should (= (point) (point-min))))) 2722 (should (= (point) (point-min)))))
2723 2723
2724(ert-deftest python-triple-quote-pairing () 2724(ert-deftest python-triple-quote-pairing ()
2725 (python-tests-with-temp-buffer 2725 (require 'electric)
2726 "\"\"\n" 2726 (let ((epm electric-pair-mode))
2727 (goto-char (1- (point-max))) 2727 (unwind-protect
2728 (let ((last-command-event ?\")) 2728 (progn
2729 (call-interactively 'self-insert-command)) 2729 (python-tests-with-temp-buffer
2730 (should (string= (buffer-string) 2730 "\"\"\n"
2731 "\"\"\"\"\"\"\n")) 2731 (or epm (electric-pair-mode 1))
2732 (should (= (point) 4))) 2732 (goto-char (1- (point-max)))
2733 (python-tests-with-temp-buffer 2733 (let ((last-command-event ?\"))
2734 "\n" 2734 (call-interactively 'self-insert-command))
2735 (let ((last-command-event ?\")) 2735 (should (string= (buffer-string)
2736 (dotimes (i 3) 2736 "\"\"\"\"\"\"\n"))
2737 (call-interactively 'self-insert-command))) 2737 (should (= (point) 4)))
2738 (should (string= (buffer-string) 2738 (python-tests-with-temp-buffer
2739 "\"\"\"\"\"\"\n")) 2739 "\n"
2740 (should (= (point) 4))) 2740 (let ((last-command-event ?\"))
2741 (python-tests-with-temp-buffer 2741 (dotimes (i 3)
2742 "\"\n\"\"\n" 2742 (call-interactively 'self-insert-command)))
2743 (goto-char (1- (point-max))) 2743 (should (string= (buffer-string)
2744 (let ((last-command-event ?\")) 2744 "\"\"\"\"\"\"\n"))
2745 (call-interactively 'self-insert-command)) 2745 (should (= (point) 4)))
2746 (should (= (point) (1- (point-max)))) 2746 (python-tests-with-temp-buffer
2747 (should (string= (buffer-string) 2747 "\"\n\"\"\n"
2748 "\"\n\"\"\"\n")))) 2748 (goto-char (1- (point-max)))
2749 (let ((last-command-event ?\"))
2750 (call-interactively 'self-insert-command))
2751 (should (= (point) (1- (point-max))))
2752 (should (string= (buffer-string)
2753 "\"\n\"\"\"\n"))))
2754 (or epm (electric-pair-mode -1)))))
2749 2755
2750 2756
2751(provide 'python-tests) 2757(provide 'python-tests)