aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Távora2021-09-20 11:55:41 +0100
committerJoão Távora2021-09-20 11:57:07 +0100
commitbf3276240e6990bd904813bafe07a8a69a5916af (patch)
tree6a2771a8c78b668b8d1631db25251349e8c31ccf
parentb0c34e3c207be0450fddd70620c600cd546751f2 (diff)
downloademacs-scratch/electric-pair-cleanup-and-49518-bugfix.tar.gz
emacs-scratch/electric-pair-cleanup-and-49518-bugfix.zip
Improve Python triple-quote pairing tests for electric-pair-modescratch/electric-pair-cleanup-and-49518-bugfix
These tests were once passing incorrectly, i.e. the auto-pairing functionality they purport to guard wasn't really working. Added a new test in hopes that regressions can be spotted in the future for the now-working functionality of Python triple-quote auto-pairing via electric-pair-mode. bug#49518 * test/lisp/progmodes/python-tests.el (python-triple-double-quote-pairing): Rename from python-triple-quote-pairing. (python-triple-single-quote-pairing): New test.
-rw-r--r--test/lisp/progmodes/python-tests.el29
1 files changed, 28 insertions, 1 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index a172f0f8e9c..6ab9c62746e 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -5282,7 +5282,7 @@ urlpatterns = patterns('',
5282 (should (= (current-indentation) 23)))) 5282 (should (= (current-indentation) 23))))
5283 (or eim (electric-indent-mode -1))))) 5283 (or eim (electric-indent-mode -1)))))
5284 5284
5285(ert-deftest python-triple-quote-pairing () 5285(ert-deftest python-triple-double-quote-pairing ()
5286 (let ((epm electric-pair-mode)) 5286 (let ((epm electric-pair-mode))
5287 (unwind-protect 5287 (unwind-protect
5288 (progn 5288 (progn
@@ -5309,6 +5309,33 @@ urlpatterns = patterns('',
5309 "\"\n\"\"\"\n")))) 5309 "\"\n\"\"\"\n"))))
5310 (or epm (electric-pair-mode -1))))) 5310 (or epm (electric-pair-mode -1)))))
5311 5311
5312(ert-deftest python-triple-single-quote-pairing ()
5313 (let ((epm electric-pair-mode))
5314 (unwind-protect
5315 (progn
5316 (python-tests-with-temp-buffer
5317 "''\n"
5318 (or epm (electric-pair-mode 1))
5319 (goto-char (1- (point-max)))
5320 (python-tests-self-insert ?')
5321 (should (string= (buffer-string)
5322 "''''''\n"))
5323 (should (= (point) 4)))
5324 (python-tests-with-temp-buffer
5325 "\n"
5326 (python-tests-self-insert (list ?' ?' ?'))
5327 (should (string= (buffer-string)
5328 "''''''\n"))
5329 (should (= (point) 4)))
5330 (python-tests-with-temp-buffer
5331 "'\n''\n"
5332 (goto-char (1- (point-max)))
5333 (python-tests-self-insert ?')
5334 (should (= (point) (1- (point-max))))
5335 (should (string= (buffer-string)
5336 "'\n'''\n"))))
5337 (or epm (electric-pair-mode -1)))))
5338
5312 5339
5313;;; Hideshow support 5340;;; Hideshow support
5314 5341