diff options
| author | kobarity | 2022-07-23 10:26:33 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2022-07-23 10:26:33 +0200 |
| commit | 09e433ec7f8b2c25d5be2cdb5aac5e089a6e4cea (patch) | |
| tree | 256a15b13364bb32416092548a9195256444faa0 /test/lisp/progmodes/python-tests.el | |
| parent | df667e9f17a071a6471f629d994f6298c2ec0a9d (diff) | |
| download | emacs-09e433ec7f8b2c25d5be2cdb5aac5e089a6e4cea.tar.gz emacs-09e433ec7f8b2c25d5be2cdb5aac5e089a6e4cea.zip | |
Fix Python navigation problem with a line continuation using backslash
* lisp/progmodes/python.el (python-nav--beginning-of-defun): Fix
line continuation using backslash in nested defun (bug#56615).
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
| -rw-r--r-- | test/lisp/progmodes/python-tests.el | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index b2cccdd9569..3b10bde23bc 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el | |||
| @@ -1995,6 +1995,32 @@ def c(): | |||
| 1995 | (beginning-of-line) | 1995 | (beginning-of-line) |
| 1996 | (point)))))) | 1996 | (point)))))) |
| 1997 | 1997 | ||
| 1998 | (ert-deftest python-nav-beginning-of-defun-5 () | ||
| 1999 | (python-tests-with-temp-buffer | ||
| 2000 | " | ||
| 2001 | class C: | ||
| 2002 | |||
| 2003 | def \\ | ||
| 2004 | m(self): | ||
| 2005 | pass | ||
| 2006 | " | ||
| 2007 | (python-tests-look-at "m(self):") | ||
| 2008 | (should (= (save-excursion | ||
| 2009 | (python-nav-beginning-of-defun) | ||
| 2010 | (point)) | ||
| 2011 | (save-excursion | ||
| 2012 | (python-tests-look-at "def \\" -1) | ||
| 2013 | (beginning-of-line) | ||
| 2014 | (point)))) | ||
| 2015 | (python-tests-look-at "class C:" -1) | ||
| 2016 | (should (= (save-excursion | ||
| 2017 | (python-nav-beginning-of-defun -1) | ||
| 2018 | (point)) | ||
| 2019 | (save-excursion | ||
| 2020 | (python-tests-look-at "def \\") | ||
| 2021 | (beginning-of-line) | ||
| 2022 | (point)))))) | ||
| 2023 | |||
| 1998 | (ert-deftest python-nav-end-of-defun-1 () | 2024 | (ert-deftest python-nav-end-of-defun-1 () |
| 1999 | (python-tests-with-temp-buffer | 2025 | (python-tests-with-temp-buffer |
| 2000 | " | 2026 | " |