diff options
| author | kobarity | 2022-08-15 16:30:23 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2022-08-15 16:30:23 +0200 |
| commit | 0d3aebec0141ab57362477c50065222a03d57c08 (patch) | |
| tree | 4d55d885963c668ccb58fa4084ba326e22721574 /test/lisp/progmodes/python-tests.el | |
| parent | 5025b2566e72ba37b62c2a00feef46268fc9f468 (diff) | |
| download | emacs-0d3aebec0141ab57362477c50065222a03d57c08.tar.gz emacs-0d3aebec0141ab57362477c50065222a03d57c08.zip | |
Fix `python-nav-forward-block' moving backward under certain conditions
* lisp/progmodes/python.el (python-nav-forward-block): Add check
for not moving backward (bug#57223).
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
| -rw-r--r-- | test/lisp/progmodes/python-tests.el | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index d303050fad9..9e8fa7f5520 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el | |||
| @@ -2942,6 +2942,22 @@ if request.user.is_authenticated(): | |||
| 2942 | (python-tests-look-at | 2942 | (python-tests-look-at |
| 2943 | "if request.user.is_authenticated():" -1))))) | 2943 | "if request.user.is_authenticated():" -1))))) |
| 2944 | 2944 | ||
| 2945 | (ert-deftest python-nav-forward-block-2 () | ||
| 2946 | (python-tests-with-temp-buffer | ||
| 2947 | " | ||
| 2948 | if True: | ||
| 2949 | pass | ||
| 2950 | " | ||
| 2951 | (python-tests-look-at "if True:") | ||
| 2952 | (should (not (save-excursion (python-nav-forward-block)))) | ||
| 2953 | (should (not (save-excursion (python-nav-forward-block -1)))) | ||
| 2954 | (forward-char) | ||
| 2955 | (should (not (save-excursion (python-nav-forward-block)))) | ||
| 2956 | (should (= (save-excursion (python-nav-forward-block -1)) | ||
| 2957 | (progn | ||
| 2958 | (end-of-line) | ||
| 2959 | (python-tests-look-at "if True:" -1)))))) | ||
| 2960 | |||
| 2945 | (ert-deftest python-nav-forward-sexp-1 () | 2961 | (ert-deftest python-nav-forward-sexp-1 () |
| 2946 | (python-tests-with-temp-buffer | 2962 | (python-tests-with-temp-buffer |
| 2947 | " | 2963 | " |