diff options
| author | kobarity | 2022-11-07 22:24:44 +0900 |
|---|---|---|
| committer | Eli Zaretskii | 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 emacs-f8df45f853752bb842af453dd05ccb64d990b767.zip | |
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: | |||
| 5592 | (equal (list (python-tests-look-at "else:" -1 t)) | 5592 | (equal (list (python-tests-look-at "else:" -1 t)) |
| 5593 | (python-info-dedenter-opening-block-positions))))) | 5593 | (python-info-dedenter-opening-block-positions))))) |
| 5594 | 5594 | ||
| 5595 | (ert-deftest python-info-dedenter-opening-block-positions-6 () | ||
| 5596 | "Test multiline block start." | ||
| 5597 | (python-tests-with-temp-buffer | ||
| 5598 | " | ||
| 5599 | def func(): | ||
| 5600 | if ( | ||
| 5601 | cond1 or | ||
| 5602 | cond2 | ||
| 5603 | ): | ||
| 5604 | something() | ||
| 5605 | else | ||
| 5606 | " | ||
| 5607 | (python-tests-look-at "else\n") | ||
| 5608 | (should | ||
| 5609 | (equal (list (python-tests-look-at "if (" -1 t)) | ||
| 5610 | (python-info-dedenter-opening-block-positions))))) | ||
| 5611 | |||
| 5595 | (ert-deftest python-info-dedenter-opening-block-message-1 () | 5612 | (ert-deftest python-info-dedenter-opening-block-message-1 () |
| 5596 | "Test dedenters inside strings are ignored." | 5613 | "Test dedenters inside strings are ignored." |
| 5597 | (python-tests-with-temp-buffer | 5614 | (python-tests-with-temp-buffer |