diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/lisp/progmodes/python-tests.el | 20 | ||||
-rw-r--r-- | test/lisp/textmodes/sgml-mode-tests.el | 2 | ||||
-rw-r--r-- | test/lisp/wdired-tests.el | 6 |
3 files changed, 22 insertions, 6 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 87cee189eac..b1cf7e8806a 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -134,6 +134,16 @@ default to `point-min' and `point-max' respectively." (overlay-end overlay)))) (buffer-substring-no-properties (point-min) (point-max))))) +(defun python-virt-bin (&optional virt-root) + "Return the virtualenv bin dir, starting from VIRT-ROOT. +If nil, VIRT-ROOT defaults to `python-shell-virtualenv-root'. +The name of this directory depends on `system-type'." + (expand-file-name + (concat + (file-name-as-directory (or virt-root + python-shell-virtualenv-root)) + (if (eq system-type 'windows-nt) "Scripts" "bin")))) + ;;; Tests for your tests, so you can test while you test. @@ -2704,7 +2714,7 @@ if x: (python-shell-virtualenv-root "/env") (new-exec-path (python-shell-calculate-exec-path))) (should (equal new-exec-path - (list (expand-file-name "/env/bin") "/path0"))))) + (list (python-virt-bin) "/path0"))))) (ert-deftest python-shell-calculate-exec-path-3 () "Test complete `python-shell-virtualenv-root' modification." @@ -2713,7 +2723,7 @@ if x: (python-shell-virtualenv-root "/env") (new-exec-path (python-shell-calculate-exec-path))) (should (equal new-exec-path - (list (expand-file-name "/env/bin") + (list (python-virt-bin) "/path1" "/path2" "/path0"))))) (ert-deftest python-shell-calculate-exec-path-4 () @@ -2724,7 +2734,7 @@ if x: (python-shell-virtualenv-root "/env") (new-exec-path (python-shell-calculate-exec-path))) (should (equal new-exec-path - (list (expand-file-name "/env/bin") + (list (python-virt-bin) "/path1" "/path2" "/path0"))))) (ert-deftest python-shell-calculate-exec-path-5 () @@ -2754,7 +2764,7 @@ if x: (python-shell-virtualenv-root "/env")) (python-shell-with-environment (should (equal exec-path - (list (expand-file-name "/env/bin") + (list (python-virt-bin) "/path1" "/path2" "/path0"))) (should (not (getenv "PYTHONHOME"))) (should (string= (getenv "VIRTUAL_ENV") "/env"))) @@ -2770,7 +2780,7 @@ if x: (python-shell-virtualenv-root "/env")) (python-shell-with-environment (should (equal (python-shell-calculate-exec-path) - (list (expand-file-name "/env/bin") + (list (python-virt-bin) "/path1" "/path2" "/remote1" "/remote2"))) (let ((process-environment (python-shell-calculate-process-environment))) (should (not (getenv "PYTHONHOME"))) diff --git a/test/lisp/textmodes/sgml-mode-tests.el b/test/lisp/textmodes/sgml-mode-tests.el index 34d26480a45..5630036e55c 100644 --- a/test/lisp/textmodes/sgml-mode-tests.el +++ b/test/lisp/textmodes/sgml-mode-tests.el @@ -171,6 +171,8 @@ The point is set to the beginning of the buffer." "<tag>c>'d</tag>" "<t><!-- \" --></t>" "<t><!-- ' --></t>" + "<t>(')</t>" + "<t>(\")</t>" )) (with-temp-buffer (sgml-mode) diff --git a/test/lisp/wdired-tests.el b/test/lisp/wdired-tests.el index 9682843db29..6db2e03e752 100644 --- a/test/lisp/wdired-tests.el +++ b/test/lisp/wdired-tests.el @@ -86,7 +86,11 @@ only the name before the link arrow." (let ((buf (find-file-noselect test-dir))) (unwind-protect (with-current-buffer buf - (make-symbolic-link "./bar/baz" link-name) + (skip-unless + ;; This check is for wdired, not symbolic links, so skip + ;; it when make-symbolic-link fails for any reason (like + ;; insufficient privileges). + (ignore-errors (make-symbolic-link "./bar/baz" link-name) t)) (revert-buffer) (let* ((file-name (dired-get-filename)) (dir-part (file-name-directory file-name)) |