summaryrefslogtreecommitdiff
path: root/test/automated/python-tests.el
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-07-26 14:02:53 -0600
committerTom Tromey <tromey@redhat.com>2013-07-26 14:02:53 -0600
commitcc231cbe45d27a1906d268fb72d3b4105a2e9c65 (patch)
treec011828e2a3a18e77eaa8849e3cccb805d798f42 /test/automated/python-tests.el
parentb34a529f177a6ea32da5cb1254f91bf9d71838db (diff)
parentfec9206062b420aca84f53d05a72c3ee43244022 (diff)
downloademacs-cc231cbe45d27a1906d268fb72d3b4105a2e9c65.tar.gz
emacs-cc231cbe45d27a1906d268fb72d3b4105a2e9c65.tar.bz2
emacs-cc231cbe45d27a1906d268fb72d3b4105a2e9c65.zip
merge from trunk
Diffstat (limited to 'test/automated/python-tests.el')
-rw-r--r--test/automated/python-tests.el47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el
index 1dffe9544fe..fdae235ad38 100644
--- a/test/automated/python-tests.el
+++ b/test/automated/python-tests.el
@@ -1745,6 +1745,53 @@ class Baz(object):
(cons "c (def)" (copy-marker 626)))))
(python-imenu-create-index)))))
+(ert-deftest python-imenu-create-index-2 ()
+ (python-tests-with-temp-buffer
+ "
+class Foo(object):
+ def foo(self):
+ def foo1():
+ pass
+
+ def foobar(self):
+ pass
+"
+ (goto-char (point-max))
+ (should (equal
+ (list
+ (list
+ "Foo (class)"
+ (cons "*class definition*" (copy-marker 2))
+ (list
+ "foo (def)"
+ (cons "*function definition*" (copy-marker 21))
+ (cons "foo1 (def)" (copy-marker 40)))
+ (cons "foobar (def)" (copy-marker 78))))
+ (python-imenu-create-index)))))
+
+(ert-deftest python-imenu-create-index-3 ()
+ (python-tests-with-temp-buffer
+ "
+class Foo(object):
+ def foo(self):
+ def foo1():
+ pass
+ def foo2():
+ pass
+"
+ (goto-char (point-max))
+ (should (equal
+ (list
+ (list
+ "Foo (class)"
+ (cons "*class definition*" (copy-marker 2))
+ (list
+ "foo (def)"
+ (cons "*function definition*" (copy-marker 21))
+ (cons "foo1 (def)" (copy-marker 40))
+ (cons "foo2 (def)" (copy-marker 77)))))
+ (python-imenu-create-index)))))
+
(ert-deftest python-imenu-create-flat-index-1 ()
(python-tests-with-temp-buffer
"