diff options
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
| -rw-r--r-- | test/lisp/progmodes/python-tests.el | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 92c20288c8e..b2cccdd9569 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el | |||
| @@ -1876,7 +1876,7 @@ class C(object): | |||
| 1876 | (beginning-of-line) | 1876 | (beginning-of-line) |
| 1877 | (point)))) | 1877 | (point)))) |
| 1878 | ;; Nested defuns should be skipped. | 1878 | ;; Nested defuns should be skipped. |
| 1879 | (python-tests-look-at "return a" -1) | 1879 | (forward-line -1) |
| 1880 | (should (= (save-excursion | 1880 | (should (= (save-excursion |
| 1881 | (python-nav-beginning-of-defun) | 1881 | (python-nav-beginning-of-defun) |
| 1882 | (point)) | 1882 | (point)) |
| @@ -1885,6 +1885,15 @@ class C(object): | |||
| 1885 | (beginning-of-line) | 1885 | (beginning-of-line) |
| 1886 | (point)))) | 1886 | (point)))) |
| 1887 | ;; Defuns on same levels should be respected. | 1887 | ;; Defuns on same levels should be respected. |
| 1888 | (python-tests-look-at "if True:" -1) | ||
| 1889 | (forward-line -1) | ||
| 1890 | (should (= (save-excursion | ||
| 1891 | (python-nav-beginning-of-defun) | ||
| 1892 | (point)) | ||
| 1893 | (save-excursion | ||
| 1894 | (python-tests-look-at "def a():" -1) | ||
| 1895 | (beginning-of-line) | ||
| 1896 | (point)))) | ||
| 1888 | (python-tests-look-at "def a():" -1) | 1897 | (python-tests-look-at "def a():" -1) |
| 1889 | (should (= (save-excursion | 1898 | (should (= (save-excursion |
| 1890 | (python-nav-beginning-of-defun) | 1899 | (python-nav-beginning-of-defun) |
| @@ -1893,7 +1902,7 @@ class C(object): | |||
| 1893 | (python-tests-look-at "def b():" -1) | 1902 | (python-tests-look-at "def b():" -1) |
| 1894 | (beginning-of-line) | 1903 | (beginning-of-line) |
| 1895 | (point)))) | 1904 | (point)))) |
| 1896 | ;; Jump to a top level defun. | 1905 | ;; Jump to an upper level defun. |
| 1897 | (python-tests-look-at "def b():" -1) | 1906 | (python-tests-look-at "def b():" -1) |
| 1898 | (should (= (save-excursion | 1907 | (should (= (save-excursion |
| 1899 | (python-nav-beginning-of-defun) | 1908 | (python-nav-beginning-of-defun) |
| @@ -1902,6 +1911,14 @@ class C(object): | |||
| 1902 | (python-tests-look-at "def m(self):" -1) | 1911 | (python-tests-look-at "def m(self):" -1) |
| 1903 | (beginning-of-line) | 1912 | (beginning-of-line) |
| 1904 | (point)))) | 1913 | (point)))) |
| 1914 | (forward-line -1) | ||
| 1915 | (should (= (save-excursion | ||
| 1916 | (python-nav-beginning-of-defun) | ||
| 1917 | (point)) | ||
| 1918 | (save-excursion | ||
| 1919 | (python-tests-look-at "def m(self):" -1) | ||
| 1920 | (beginning-of-line) | ||
| 1921 | (point)))) | ||
| 1905 | ;; Jump to a top level defun again. | 1922 | ;; Jump to a top level defun again. |
| 1906 | (python-tests-look-at "def m(self):" -1) | 1923 | (python-tests-look-at "def m(self):" -1) |
| 1907 | (should (= (save-excursion | 1924 | (should (= (save-excursion |
| @@ -2011,12 +2028,25 @@ class C(object): | |||
| 2011 | (point)))) | 2028 | (point)))) |
| 2012 | (should (= (save-excursion | 2029 | (should (= (save-excursion |
| 2013 | (python-tests-look-at "def b():") | 2030 | (python-tests-look-at "def b():") |
| 2031 | (forward-line -1) | ||
| 2032 | (python-nav-end-of-defun) | ||
| 2033 | (point)) | ||
| 2034 | (save-excursion | ||
| 2035 | (python-tests-look-at "def c(self):") | ||
| 2036 | (forward-line -1) | ||
| 2037 | (point)))) | ||
| 2038 | (should (= (save-excursion | ||
| 2039 | (python-tests-look-at "def b():") | ||
| 2014 | (python-nav-end-of-defun) | 2040 | (python-nav-end-of-defun) |
| 2015 | (point)) | 2041 | (point)) |
| 2016 | (save-excursion | 2042 | (save-excursion |
| 2017 | (python-tests-look-at "def b():") | 2043 | (python-tests-look-at "def b():") |
| 2018 | (forward-line 2) | 2044 | (forward-line 2) |
| 2019 | (point)))) | 2045 | (point)))) |
| 2046 | (should (not (save-excursion | ||
| 2047 | (python-tests-look-at "def a():") | ||
| 2048 | (forward-line -1) | ||
| 2049 | (python-nav-end-of-defun)))) | ||
| 2020 | (should (= (save-excursion | 2050 | (should (= (save-excursion |
| 2021 | (python-tests-look-at "def c(self):") | 2051 | (python-tests-look-at "def c(self):") |
| 2022 | (python-nav-end-of-defun) | 2052 | (python-nav-end-of-defun) |