summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2013-03-30 09:55:47 -0700
committerGlenn Morris <rgm@gnu.org>2013-03-30 09:55:47 -0700
commit8d3655be5a5c41b1f0a9985bcdb614693fce67e5 (patch)
treec213796b69a9d40c6563c211c20ea815754ad560 /test
parent14a581695f7b9c70b8531a41a327a2e01f6125ba (diff)
parentb011a6e8011c51e09f28d528a541509c17d4eed0 (diff)
downloademacs-8d3655be5a5c41b1f0a9985bcdb614693fce67e5.tar.gz
Merge from emacs-24; up to 2012-12-26T16:22:18Z!michael.albinus@gmx.de
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog5
-rw-r--r--test/automated/python-tests.el30
2 files changed, 31 insertions, 4 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 43648ad1bb1..cd4414cd079 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-30 Fabián Ezequiel Gallina <fabian@anue.biz>
+
+ * automated/python-tests.el (python-indent-block-enders): New test.
+ (python-info-current-defun-2): Fix test.
+
2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
* indent/octave.m: Fix encoding error in comment. Add coding tag.
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el
index ab8eb4816d3..d0a7ab57250 100644
--- a/test/automated/python-tests.el
+++ b/test/automated/python-tests.el
@@ -444,6 +444,28 @@ objects = Thing.objects.all() \\\\
(should (eq (car (python-indent-context)) 'after-line))
(should (= (python-indent-calculate-indentation) 0))))
+(ert-deftest python-indent-block-enders ()
+ "Test `python-indent-block-enders' value honouring."
+ (python-tests-with-temp-buffer
+ "
+Class foo(object):
+
+ def bar(self):
+ if self.baz:
+ return (1,
+ 2,
+ 3)
+
+ else:
+ pass
+"
+ (python-tests-look-at "3)")
+ (forward-line 1)
+ (= (python-indent-calculate-indentation) 12)
+ (python-tests-look-at "pass")
+ (forward-line 1)
+ (= (python-indent-calculate-indentation) 8)))
+
;;; Navigation
@@ -1546,13 +1568,13 @@ class C(object):
return []
def b():
- pass
+ do_b()
def a():
- pass
+ do_a()
def c(self):
- pass
+ do_c()
"
(forward-line 1)
(should (string= "C" (python-info-current-defun)))
@@ -1582,7 +1604,7 @@ class C(object):
(python-tests-look-at "def c(self):")
(should (string= "C.c" (python-info-current-defun)))
(should (string= "def C.c" (python-info-current-defun t)))
- (python-tests-look-at "pass")
+ (python-tests-look-at "do_c()")
(should (string= "C.c" (python-info-current-defun)))
(should (string= "def C.c" (python-info-current-defun t)))))