mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
Fix Python block end predicates (bug#77941)
* lisp/progmodes/python.el (python-info-statement-ends-block-p) (python-info-end-of-block-p): Add consideration of comments. * test/lisp/progmodes/python-tests.el (python-info-statement-ends-block-p-3) (python-info-end-of-block-p-3): New tests.
This commit is contained in:
parent
7bb648eb80
commit
55cf15e163
2 changed files with 25 additions and 2 deletions
|
|
@ -5821,6 +5821,15 @@ if width == 0 and height == 0 and \\
|
|||
(python-tests-look-at "raise ValueError(")
|
||||
(should (python-info-statement-ends-block-p))))
|
||||
|
||||
(ert-deftest python-info-statement-ends-block-p-3 ()
|
||||
(python-tests-with-temp-buffer
|
||||
"
|
||||
def function():
|
||||
print() # Comment
|
||||
"
|
||||
(python-tests-look-at "print()")
|
||||
(should (python-info-statement-ends-block-p))))
|
||||
|
||||
(ert-deftest python-info-beginning-of-statement-p-1 ()
|
||||
(python-tests-with-temp-buffer
|
||||
"
|
||||
|
|
@ -5983,6 +5992,15 @@ if width == 0 and height == 0 and \\
|
|||
(python-util-forward-comment -1)
|
||||
(should (python-info-end-of-block-p))))
|
||||
|
||||
(ert-deftest python-info-end-of-block-p-3 ()
|
||||
(python-tests-with-temp-buffer
|
||||
"
|
||||
def function():
|
||||
print() # Comment
|
||||
"
|
||||
(python-tests-look-at " # Comment")
|
||||
(should (python-info-end-of-block-p))))
|
||||
|
||||
(ert-deftest python-info-dedenter-opening-block-position-1 ()
|
||||
(python-tests-with-temp-buffer
|
||||
"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue