aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/progmodes/python-tests.el
diff options
context:
space:
mode:
authorkobarity2022-08-07 16:10:26 +0200
committerLars Ingebrigtsen2022-08-07 16:10:58 +0200
commit11e6c12def5e617fb07d604e82c9bf5289c6e827 (patch)
tree819526971489cc7426cb411136744be45ada52dd /test/lisp/progmodes/python-tests.el
parent75929535530d7c5ab48565a33b33b4e84026b368 (diff)
downloademacs-11e6c12def5e617fb07d604e82c9bf5289c6e827.tar.gz
emacs-11e6c12def5e617fb07d604e82c9bf5289c6e827.zip
Fix blank/comment line handling in python-nav-beginning-of-block
* lisp/progmodes/python.el (python-nav-beginning-of-block): Fix handling of blank/comment line right after block start (bug#57038).
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
-rw-r--r--test/lisp/progmodes/python-tests.el22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index 07f2c4f09a3..eb571226909 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -2734,6 +2734,28 @@ def decoratorFunctionWithArguments(arg1, arg2, arg3):
2734 (point)) 2734 (point))
2735 (python-tests-look-at "def wwrap(f):" -1))))) 2735 (python-tests-look-at "def wwrap(f):" -1)))))
2736 2736
2737(ert-deftest python-nav-beginning-of-block-2 ()
2738 (python-tests-with-temp-buffer
2739 "
2740if True:
2741
2742 pass
2743if False:
2744 # comment
2745 pass
2746"
2747 (python-tests-look-at "if True:")
2748 (forward-line)
2749 (should (= (save-excursion
2750 (python-nav-beginning-of-block)
2751 (point))
2752 (python-tests-look-at "if True:" -1)))
2753 (python-tests-look-at "# comment")
2754 (should (= (save-excursion
2755 (python-nav-beginning-of-block)
2756 (point))
2757 (python-tests-look-at "if False:" -1)))))
2758
2737(ert-deftest python-nav-end-of-block-1 () 2759(ert-deftest python-nav-end-of-block-1 ()
2738 (python-tests-with-temp-buffer 2760 (python-tests-with-temp-buffer
2739 " 2761 "