aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lisp/progmodes/python-tests.el20
-rw-r--r--test/lisp/textmodes/sgml-mode-tests.el2
-rw-r--r--test/lisp/wdired-tests.el6
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."
134 (overlay-end overlay)))) 134 (overlay-end overlay))))
135 (buffer-substring-no-properties (point-min) (point-max))))) 135 (buffer-substring-no-properties (point-min) (point-max)))))
136 136
137(defun python-virt-bin (&optional virt-root)
138 "Return the virtualenv bin dir, starting from VIRT-ROOT.
139If nil, VIRT-ROOT defaults to `python-shell-virtualenv-root'.
140The name of this directory depends on `system-type'."
141 (expand-file-name
142 (concat
143 (file-name-as-directory (or virt-root
144 python-shell-virtualenv-root))
145 (if (eq system-type 'windows-nt) "Scripts" "bin"))))
146
137 147
138;;; Tests for your tests, so you can test while you test. 148;;; Tests for your tests, so you can test while you test.
139 149
@@ -2704,7 +2714,7 @@ if x:
2704 (python-shell-virtualenv-root "/env") 2714 (python-shell-virtualenv-root "/env")
2705 (new-exec-path (python-shell-calculate-exec-path))) 2715 (new-exec-path (python-shell-calculate-exec-path)))
2706 (should (equal new-exec-path 2716 (should (equal new-exec-path
2707 (list (expand-file-name "/env/bin") "/path0"))))) 2717 (list (python-virt-bin) "/path0")))))
2708 2718
2709(ert-deftest python-shell-calculate-exec-path-3 () 2719(ert-deftest python-shell-calculate-exec-path-3 ()
2710 "Test complete `python-shell-virtualenv-root' modification." 2720 "Test complete `python-shell-virtualenv-root' modification."
@@ -2713,7 +2723,7 @@ if x:
2713 (python-shell-virtualenv-root "/env") 2723 (python-shell-virtualenv-root "/env")
2714 (new-exec-path (python-shell-calculate-exec-path))) 2724 (new-exec-path (python-shell-calculate-exec-path)))
2715 (should (equal new-exec-path 2725 (should (equal new-exec-path
2716 (list (expand-file-name "/env/bin") 2726 (list (python-virt-bin)
2717 "/path1" "/path2" "/path0"))))) 2727 "/path1" "/path2" "/path0")))))
2718 2728
2719(ert-deftest python-shell-calculate-exec-path-4 () 2729(ert-deftest python-shell-calculate-exec-path-4 ()
@@ -2724,7 +2734,7 @@ if x:
2724 (python-shell-virtualenv-root "/env") 2734 (python-shell-virtualenv-root "/env")
2725 (new-exec-path (python-shell-calculate-exec-path))) 2735 (new-exec-path (python-shell-calculate-exec-path)))
2726 (should (equal new-exec-path 2736 (should (equal new-exec-path
2727 (list (expand-file-name "/env/bin") 2737 (list (python-virt-bin)
2728 "/path1" "/path2" "/path0"))))) 2738 "/path1" "/path2" "/path0")))))
2729 2739
2730(ert-deftest python-shell-calculate-exec-path-5 () 2740(ert-deftest python-shell-calculate-exec-path-5 ()
@@ -2754,7 +2764,7 @@ if x:
2754 (python-shell-virtualenv-root "/env")) 2764 (python-shell-virtualenv-root "/env"))
2755 (python-shell-with-environment 2765 (python-shell-with-environment
2756 (should (equal exec-path 2766 (should (equal exec-path
2757 (list (expand-file-name "/env/bin") 2767 (list (python-virt-bin)
2758 "/path1" "/path2" "/path0"))) 2768 "/path1" "/path2" "/path0")))
2759 (should (not (getenv "PYTHONHOME"))) 2769 (should (not (getenv "PYTHONHOME")))
2760 (should (string= (getenv "VIRTUAL_ENV") "/env"))) 2770 (should (string= (getenv "VIRTUAL_ENV") "/env")))
@@ -2770,7 +2780,7 @@ if x:
2770 (python-shell-virtualenv-root "/env")) 2780 (python-shell-virtualenv-root "/env"))
2771 (python-shell-with-environment 2781 (python-shell-with-environment
2772 (should (equal (python-shell-calculate-exec-path) 2782 (should (equal (python-shell-calculate-exec-path)
2773 (list (expand-file-name "/env/bin") 2783 (list (python-virt-bin)
2774 "/path1" "/path2" "/remote1" "/remote2"))) 2784 "/path1" "/path2" "/remote1" "/remote2")))
2775 (let ((process-environment (python-shell-calculate-process-environment))) 2785 (let ((process-environment (python-shell-calculate-process-environment)))
2776 (should (not (getenv "PYTHONHOME"))) 2786 (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."
171 "<tag>c>'d</tag>" 171 "<tag>c>'d</tag>"
172 "<t><!-- \" --></t>" 172 "<t><!-- \" --></t>"
173 "<t><!-- ' --></t>" 173 "<t><!-- ' --></t>"
174 "<t>(')</t>"
175 "<t>(\")</t>"
174 )) 176 ))
175 (with-temp-buffer 177 (with-temp-buffer
176 (sgml-mode) 178 (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."
86 (let ((buf (find-file-noselect test-dir))) 86 (let ((buf (find-file-noselect test-dir)))
87 (unwind-protect 87 (unwind-protect
88 (with-current-buffer buf 88 (with-current-buffer buf
89 (make-symbolic-link "./bar/baz" link-name) 89 (skip-unless
90 ;; This check is for wdired, not symbolic links, so skip
91 ;; it when make-symbolic-link fails for any reason (like
92 ;; insufficient privileges).
93 (ignore-errors (make-symbolic-link "./bar/baz" link-name) t))
90 (revert-buffer) 94 (revert-buffer)
91 (let* ((file-name (dired-get-filename)) 95 (let* ((file-name (dired-get-filename))
92 (dir-part (file-name-directory file-name)) 96 (dir-part (file-name-directory file-name))