emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r116929: Fix python-triple-quote-pairing test


From: Glenn Morris
Subject: [Emacs-diffs] emacs-24 r116929: Fix python-triple-quote-pairing test
Date: Wed, 09 Apr 2014 01:50:31 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116929
revision-id: address@hidden
parent: address@hidden
committer: Glenn Morris <address@hidden>
branch nick: emacs-24
timestamp: Tue 2014-04-08 21:50:29 -0400
message:
  Fix python-triple-quote-pairing test
  
  * test/automated/python-tests.el (python-triple-quote-pairing):
  Enable/disable electric-pair-mode as needed.
modified:
  test/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-8588
  test/automated/python-tests.el 
pythontests.el-20130220195218-kqcioz3fssz9hwe1-1
=== modified file 'test/ChangeLog'
--- a/test/ChangeLog    2014-04-09 01:34:16 +0000
+++ b/test/ChangeLog    2014-04-09 01:50:29 +0000
@@ -1,5 +1,8 @@
 2014-04-09  Glenn Morris  <address@hidden>
 
+       * automated/python-tests.el (python-triple-quote-pairing):
+       Enable/disable electric-pair-mode as needed.
+
        * automated/electric-tests.el (electric-pair-backspace-1):
        Replace deleted function.
 

=== modified file 'test/automated/python-tests.el'
--- a/test/automated/python-tests.el    2014-04-06 23:23:45 +0000
+++ b/test/automated/python-tests.el    2014-04-09 01:50:29 +0000
@@ -2722,30 +2722,36 @@
    (should (= (point) (point-min)))))
 
 (ert-deftest python-triple-quote-pairing ()
-  (python-tests-with-temp-buffer
-      "\"\"\n"
-    (goto-char (1- (point-max)))
-    (let ((last-command-event ?\"))
-      (call-interactively 'self-insert-command))
-    (should (string= (buffer-string)
-                     "\"\"\"\"\"\"\n"))
-    (should (= (point) 4)))
-  (python-tests-with-temp-buffer
-      "\n"
-    (let ((last-command-event ?\"))
-      (dotimes (i 3)
-        (call-interactively 'self-insert-command)))
-    (should (string= (buffer-string)
-                     "\"\"\"\"\"\"\n"))
-    (should (= (point) 4)))
-  (python-tests-with-temp-buffer
-      "\"\n\"\"\n"
-    (goto-char (1- (point-max)))
-    (let ((last-command-event ?\"))
-      (call-interactively 'self-insert-command))
-    (should (= (point) (1- (point-max))))
-    (should (string= (buffer-string)
-                     "\"\n\"\"\"\n"))))
+  (require 'electric)
+  (let ((epm electric-pair-mode))
+    (unwind-protect
+        (progn
+          (python-tests-with-temp-buffer
+           "\"\"\n"
+           (or epm (electric-pair-mode 1))
+           (goto-char (1- (point-max)))
+           (let ((last-command-event ?\"))
+             (call-interactively 'self-insert-command))
+           (should (string= (buffer-string)
+                            "\"\"\"\"\"\"\n"))
+           (should (= (point) 4)))
+          (python-tests-with-temp-buffer
+           "\n"
+           (let ((last-command-event ?\"))
+             (dotimes (i 3)
+               (call-interactively 'self-insert-command)))
+           (should (string= (buffer-string)
+                            "\"\"\"\"\"\"\n"))
+           (should (= (point) 4)))
+          (python-tests-with-temp-buffer
+           "\"\n\"\"\n"
+           (goto-char (1- (point-max)))
+           (let ((last-command-event ?\"))
+             (call-interactively 'self-insert-command))
+           (should (= (point) (1- (point-max))))
+           (should (string= (buffer-string)
+                            "\"\n\"\"\"\n"))))
+      (or epm (electric-pair-mode -1)))))
 
 
 (provide 'python-tests)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]