aboutsummaryrefslogtreecommitdiffstats
path: root/test/automated/python-tests.el
diff options
context:
space:
mode:
authorFabián Ezequiel Gallina2014-11-15 19:02:52 -0300
committerFabián Ezequiel Gallina2014-11-15 19:02:52 -0300
commit92f58578cc939e0d955437fcbc87cda80c2ba05c (patch)
treecfa7284f877f5bf05e98f6f607a38ce36ccd044e /test/automated/python-tests.el
parentb6cd03a825f7b8bdd0a741f68f20f81fb541ee5b (diff)
downloademacs-92f58578cc939e0d955437fcbc87cda80c2ba05c.tar.gz
emacs-92f58578cc939e0d955437fcbc87cda80c2ba05c.zip
Fixes: debbugs:18432
* lisp/progmodes/python.el (python-indent-calculate-levels): Fix indentation behavior multiline dedenter statement. * test/automated/python-tests.el (python-indent-dedenters-8): New test for Bug#18432.
Diffstat (limited to 'test/automated/python-tests.el')
-rw-r--r--test/automated/python-tests.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el
index 8c657c38b64..f368f995cae 100644
--- a/test/automated/python-tests.el
+++ b/test/automated/python-tests.el
@@ -711,6 +711,21 @@ if a:
711 (should (= (python-indent-calculate-indentation) 0)) 711 (should (= (python-indent-calculate-indentation) 0))
712 (should (equal (python-indent-calculate-levels) '(0))))) 712 (should (equal (python-indent-calculate-levels) '(0)))))
713 713
714(ert-deftest python-indent-dedenters-8 ()
715 "Test indentation for Bug#18432."
716 (python-tests-with-temp-buffer
717 "
718if (a == 1 or
719 a == 2):
720 pass
721elif (a == 3 or
722a == 4):
723"
724 (python-tests-look-at "a == 4):\n")
725 (should (eq (car (python-indent-context)) 'inside-paren))
726 (should (= (python-indent-calculate-indentation) 6))
727 (should (equal (python-indent-calculate-levels) '(0 4 6)))))
728
714(ert-deftest python-indent-electric-colon-1 () 729(ert-deftest python-indent-electric-colon-1 ()
715 "Test indentation case from Bug#18228." 730 "Test indentation case from Bug#18228."
716 (python-tests-with-temp-buffer 731 (python-tests-with-temp-buffer