diff options
author | kobarity <kobarity@gmail.com> | 2022-11-07 22:24:44 +0900 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2022-11-10 12:23:52 +0200 |
commit | f8df45f853752bb842af453dd05ccb64d990b767 (patch) | |
tree | c4a398d67b63023f9e4e8c30c4ca3672693bd7c6 /test/lisp/progmodes/python-tests.el | |
parent | f7694c80d3ec67b4e79dd240fa7e5d9f1b0f9256 (diff) | |
download | emacs-f8df45f853752bb842af453dd05ccb64d990b767.tar.gz |
Fix indentation for multi-line block start in Python mode
* lisp/progmodes/python.el
(python-info-dedenter-opening-block-positions): Fix for multi-line
block start.
* test/lisp/progmodes/python-tests.el
(python-info-dedenter-opening-block-positions-6): New test. (Bug#59009)
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
-rw-r--r-- | test/lisp/progmodes/python-tests.el | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 8330525394c..f871b7bc7d9 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -5592,6 +5592,23 @@ else: (equal (list (python-tests-look-at "else:" -1 t)) (python-info-dedenter-opening-block-positions))))) +(ert-deftest python-info-dedenter-opening-block-positions-6 () + "Test multiline block start." + (python-tests-with-temp-buffer + " +def func(): + if ( + cond1 or + cond2 + ): + something() + else +" + (python-tests-look-at "else\n") + (should + (equal (list (python-tests-look-at "if (" -1 t)) + (python-info-dedenter-opening-block-positions))))) + (ert-deftest python-info-dedenter-opening-block-message-1 () "Test dedenters inside strings are ignored." (python-tests-with-temp-buffer |