aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/progmodes/python-tests.el
diff options
context:
space:
mode:
authorkobarity2022-10-16 11:26:29 +0200
committerLars Ingebrigtsen2022-10-16 11:26:29 +0200
commitcb975c6183ed1653cc8d7fe5283a9b294bf07bf4 (patch)
tree94ff57522638d9aefafbb76eee7448f4fbef4390 /test/lisp/progmodes/python-tests.el
parentf9726408f6cb56b3a97a9e76be166a5156faec0b (diff)
downloademacs-cb975c6183ed1653cc8d7fe5283a9b294bf07bf4.tar.gz
emacs-cb975c6183ed1653cc8d7fe5283a9b294bf07bf4.zip
Fix invalid search bound error in python-shell-completion-at-point
* lisp/progmodes/python.el (python-shell-completion-at-point): Add check if point is before line-start. * test/lisp/progmodes/python-tests.el (python-shell-completion-shell-buffer-1) (python-shell-completion-shell-buffer-native-1): New tests (bug#58548).
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
-rw-r--r--test/lisp/progmodes/python-tests.el27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index 97dc17ce293..71bd0e0d682 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -4509,6 +4509,33 @@ import abc
4509 (python-eldoc-function) 4509 (python-eldoc-function)
4510 (should (completion-at-point))))) 4510 (should (completion-at-point)))))
4511 4511
4512(ert-deftest python-shell-completion-shell-buffer-1 ()
4513 (skip-unless (executable-find python-tests-shell-interpreter))
4514 (python-tests-with-temp-buffer-with-shell
4515 ""
4516 (python-shell-with-shell-buffer
4517 (insert "import abc")
4518 (comint-send-input)
4519 (python-tests-shell-wait-for-prompt)
4520 (insert "abc.")
4521 (should (nth 2 (python-shell-completion-at-point)))
4522 (end-of-line 0)
4523 (should-not (nth 2 (python-shell-completion-at-point))))))
4524
4525(ert-deftest python-shell-completion-shell-buffer-native-1 ()
4526 (skip-unless (executable-find python-tests-shell-interpreter))
4527 (python-tests-with-temp-buffer-with-shell
4528 ""
4529 (python-shell-completion-native-turn-on)
4530 (python-shell-with-shell-buffer
4531 (insert "import abc")
4532 (comint-send-input)
4533 (python-tests-shell-wait-for-prompt)
4534 (insert "abc.")
4535 (should (nth 2 (python-shell-completion-at-point)))
4536 (end-of-line 0)
4537 (should-not (nth 2 (python-shell-completion-at-point))))))
4538
4512 4539
4513 4540
4514;;; PDB Track integration 4541;;; PDB Track integration