aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp
diff options
context:
space:
mode:
authorkobarity2025-08-06 23:08:49 +0900
committerEli Zaretskii2025-08-07 16:06:28 +0300
commit3d8fbb0716df669b552daef8ada02b4357ca7b49 (patch)
tree3191cf3b757172866372fbd876f9af7ba835bb58 /test/lisp
parent68aaeb3519fd7f6176050e142f0dbc27e07992d2 (diff)
downloademacs-3d8fbb0716df669b552daef8ada02b4357ca7b49.tar.gz
emacs-3d8fbb0716df669b552daef8ada02b4357ca7b49.zip
Fix Python PDB tracking for remote inferior Python
* lisp/progmodes/python.el (python-shell-local-prefix): New constant. (python-shell--convert-file-name-to-send): New function to add/remove prefix. (python-shell-send-string, python-shell-send-file): Changed to use 'python-shell--convert-file-name-to-send'. (python-pdbtrack-set-tracked-buffer): Changed to add/remove prefix. * test/lisp/progmodes/python-tests.el (python-shell--convert-file-name-to-send-1): New test. (Bug#79036)
Diffstat (limited to 'test/lisp')
-rw-r--r--test/lisp/progmodes/python-tests.el26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index d65ef39abb4..b9130da495d 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -4602,6 +4602,32 @@ and `python-shell-interpreter-args' in the new shell buffer."
4602 "^\\(o\\.t \\|\\)"))) 4602 "^\\(o\\.t \\|\\)")))
4603 (ignore-errors (delete-file startup-file)))))) 4603 (ignore-errors (delete-file startup-file))))))
4604 4604
4605(ert-deftest python-shell--convert-file-name-to-send-1 ()
4606 "Test parameters consist of a list of the following three elements.
46071. The variable `default-directory' of the process.
46082. FILE-NAME argument.
46093. The expected return value."
4610 (python-tests-with-temp-buffer-with-shell
4611 ""
4612 (let* ((path "/tmp/tmp.py")
4613 (local-path (concat python-shell-local-prefix path))
4614 (remote1-path (concat "/ssh:remote1:" path))
4615 (remote2-path (concat "/ssh:remote2:" path))
4616 (process (python-shell-get-process)))
4617 (dolist
4618 (test (list (list "/tmp" nil nil)
4619 (list "/tmp" path path)
4620 (list "/tmp" local-path path)
4621 (list "/ssh:remote1:/tmp" path local-path)
4622 (list "/ssh:remote1:/tmp" local-path local-path)
4623 (list "/ssh:remote1:/tmp" remote1-path path)
4624 (list "/ssh:remote1:/tmp" remote2-path remote2-path)))
4625 (with-current-buffer (process-buffer process)
4626 (setq default-directory (nth 0 test)))
4627 (should (string= (python-shell--convert-file-name-to-send
4628 process (nth 1 test))
4629 (nth 2 test)))))))
4630
4605(ert-deftest python-shell-buffer-substring-1 () 4631(ert-deftest python-shell-buffer-substring-1 ()
4606 "Selecting a substring of the whole buffer must match its contents." 4632 "Selecting a substring of the whole buffer must match its contents."
4607 (python-tests-with-temp-buffer 4633 (python-tests-with-temp-buffer