aboutsummaryrefslogtreecommitdiffstats
path: root/test/automated/python-tests.el
diff options
context:
space:
mode:
authorTom Tromey2013-07-26 14:02:53 -0600
committerTom Tromey2013-07-26 14:02:53 -0600
commitcc231cbe45d27a1906d268fb72d3b4105a2e9c65 (patch)
treec011828e2a3a18e77eaa8849e3cccb805d798f42 /test/automated/python-tests.el
parentb34a529f177a6ea32da5cb1254f91bf9d71838db (diff)
parentfec9206062b420aca84f53d05a72c3ee43244022 (diff)
downloademacs-cc231cbe45d27a1906d268fb72d3b4105a2e9c65.tar.gz
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):
1745 (cons "c (def)" (copy-marker 626))))) 1745 (cons "c (def)" (copy-marker 626)))))
1746 (python-imenu-create-index))))) 1746 (python-imenu-create-index)))))
1747 1747
1748(ert-deftest python-imenu-create-index-2 ()
1749 (python-tests-with-temp-buffer
1750 "
1751class Foo(object):
1752 def foo(self):
1753 def foo1():
1754 pass
1755
1756 def foobar(self):
1757 pass
1758"
1759 (goto-char (point-max))
1760 (should (equal
1761 (list
1762 (list
1763 "Foo (class)"
1764 (cons "*class definition*" (copy-marker 2))
1765 (list
1766 "foo (def)"
1767 (cons "*function definition*" (copy-marker 21))
1768 (cons "foo1 (def)" (copy-marker 40)))
1769 (cons "foobar (def)" (copy-marker 78))))
1770 (python-imenu-create-index)))))
1771
1772(ert-deftest python-imenu-create-index-3 ()
1773 (python-tests-with-temp-buffer
1774 "
1775class Foo(object):
1776 def foo(self):
1777 def foo1():
1778 pass
1779 def foo2():
1780 pass
1781"
1782 (goto-char (point-max))
1783 (should (equal
1784 (list
1785 (list
1786 "Foo (class)"
1787 (cons "*class definition*" (copy-marker 2))
1788 (list
1789 "foo (def)"
1790 (cons "*function definition*" (copy-marker 21))
1791 (cons "foo1 (def)" (copy-marker 40))
1792 (cons "foo2 (def)" (copy-marker 77)))))
1793 (python-imenu-create-index)))))
1794
1748(ert-deftest python-imenu-create-flat-index-1 () 1795(ert-deftest python-imenu-create-flat-index-1 ()
1749 (python-tests-with-temp-buffer 1796 (python-tests-with-temp-buffer
1750 " 1797 "