1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-24 07:20:37 +00:00

Add tests on electric-indentation and Python multiline strings (Bug#29305)

* test/lisp/progmodes/python-tests.el
(python-indent-electric-comma-inside-multiline-string,
python-indent-electric-comma-after-multiline-string): New tests.
This commit is contained in:
Lele Gaifax 2017-11-15 10:10:19 +01:00 committed by Noam Postavsky
parent 946bb6d225
commit c02c1f6be7

View File

@ -1109,6 +1109,37 @@ def fn(a, b, c=True):
(should (eq (car (python-indent-context)) :inside-string))
(should (= (python-indent-calculate-indentation) 4))))
(ert-deftest python-indent-electric-comma-inside-multiline-string ()
"Test indentation ...."
(python-tests-with-temp-buffer
"
a = (
'''\
- foo,
- bar
'''
"
(python-tests-look-at "- bar")
(should (eq (car (python-indent-context)) :inside-string))
(goto-char (line-end-position))
(python-tests-self-insert ",")
(should (= (current-indentation) 0))))
(ert-deftest python-indent-electric-comma-after-multiline-string ()
"Test indentation ...."
(python-tests-with-temp-buffer
"
a = (
'''\
- foo,
- bar'''
"
(python-tests-look-at "- bar'''")
(should (eq (car (python-indent-context)) :inside-string))
(goto-char (line-end-position))
(python-tests-self-insert ",")
(should (= (current-indentation) 0))))
(ert-deftest python-indent-electric-colon-1 ()
"Test indentation case from Bug#18228."
(python-tests-with-temp-buffer