aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/progmodes/python-tests.el
diff options
context:
space:
mode:
authorkobarity2024-05-25 23:20:10 +0900
committerEli Zaretskii2024-06-09 16:49:05 +0300
commit25ab3e7be8b1c71b5939682c5b5fe6810807bcc5 (patch)
tree70ce6243f94e65dba808b0f986bd64114566a143 /test/lisp/progmodes/python-tests.el
parent6cc23f4b2a5e7dd8c68f73a310e3c602804f855d (diff)
downloademacs-25ab3e7be8b1c71b5939682c5b5fe6810807bcc5.tar.gz
emacs-25ab3e7be8b1c71b5939682c5b5fe6810807bcc5.zip
Fix hiding a Python block ending with a comment
* lisp/progmodes/python.el (python-hideshow-forward-sexp-function): Move point to the end of the line. * test/lisp/progmodes/python-tests.el (python-hideshow-hide-block-2): New test. (Bug#71170)
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
-rw-r--r--test/lisp/progmodes/python-tests.el18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index 07fafde38cf..526dade335c 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -7421,6 +7421,24 @@ def f():
7421")))) 7421"))))
7422 7422
7423 7423
7424(ert-deftest python-hideshow-hide-block-2 ()
7425 "Should hide the comment at the end of the block."
7426 (python-tests-with-temp-buffer
7427 "
7428def f():
7429 a = 1 # Comment
7430"
7431 (hs-minor-mode 1)
7432 (python-tests-look-at "def")
7433 (hs-hide-block)
7434 (should
7435 (string=
7436 (python-tests-visible-string)
7437 "
7438def f():
7439"))))
7440
7441
7424(ert-deftest python-tests--python-nav-end-of-statement--infloop () 7442(ert-deftest python-tests--python-nav-end-of-statement--infloop ()
7425 "Checks that `python-nav-end-of-statement' doesn't infloop in a 7443 "Checks that `python-nav-end-of-statement' doesn't infloop in a
7426buffer with overlapping strings." 7444buffer with overlapping strings."