[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-26 c02c1f6 3/5: Add tests on electric-indentation an
From: |
Noam Postavsky |
Subject: |
[Emacs-diffs] emacs-26 c02c1f6 3/5: Add tests on electric-indentation and Python multiline strings (Bug#29305) |
Date: |
Sat, 2 Dec 2017 09:52:24 -0500 (EST) |
branch: emacs-26
commit c02c1f6be7befdaf4f3987148db18121e1081dae
Author: Lele Gaifax <address@hidden>
Commit: Noam Postavsky <address@hidden>
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.
---
test/lisp/progmodes/python-tests.el | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/test/lisp/progmodes/python-tests.el
b/test/lisp/progmodes/python-tests.el
index a598856..010eb67 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -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