From fcf6cc3177a2404eea82a5e3f4b7118e22ca5094 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Sun, 16 Jun 2019 21:57:44 +0200 Subject: Fix problem with wdired test when symlinks cannot be created. * test/lisp/wdired-tests.el (wdired-test-symlink-name): Skip test if 'make-symbolic-link' fails for whatever reason; that's not what's being tested. --- test/lisp/wdired-tests.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/lisp') diff --git a/test/lisp/wdired-tests.el b/test/lisp/wdired-tests.el index dc67796cded..b0beb3c040c 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)) -- cgit v1.2.1 From 9d48979ca8000f4d29fdfcdfec63d3ee53024ac4 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 17 Jun 2019 02:48:21 +0200 Subject: Fix Python tests depending on system-type * test/lisp/progmodes/python-tests.el (python-virt-bin): New function. (python-shell-calculate-exec-path-2) (python-shell-calculate-exec-path-3) (python-shell-calculate-exec-path-4) (python-shell-with-environment-1, python-shell-with-environment-2): Use it. --- test/lisp/progmodes/python-tests.el | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'test/lisp') diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 3ce27a687da..bea44bede9e 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'. +POSIX and Windows systems have different defauls." + (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. @@ -2664,7 +2674,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." @@ -2673,7 +2683,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 () @@ -2684,7 +2694,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 () @@ -2714,7 +2724,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"))) @@ -2730,7 +2740,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"))) -- cgit v1.2.1 From 81535eeadb5b9b964dd195b2720de2b1fc432c6e Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 17 Jun 2019 03:12:45 +0200 Subject: * test/lisp/progmodes/python-tests.el (python-virt-bin): Doc fix. --- test/lisp/progmodes/python-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/lisp') diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index bea44bede9e..a44724f1dca 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -137,7 +137,7 @@ default to `point-min' and `point-max' respectively." (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'. -POSIX and Windows systems have different defauls." +The name of this directory depends on `system-type'." (expand-file-name (concat (file-name-as-directory (or virt-root -- cgit v1.2.1 From e62ad04963982ea9cc7622b32484778845bc2ec1 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 23 Jun 2019 21:27:43 -0400 Subject: Fix sgml-mode handling of quotes within parens (Bug#36347) * lisp/textmodes/sgml-mode.el (sgml-syntax-propertize): Use syntax-ppss-table if set. This is only needed on the release branch, on master the caller (syntax-propertize) already does this. (sgml-mode): Set syntax-ppss-table to sgml-tag-syntax-table. This correctly classifies parens as punctuation, so they won't confuse the parser. * test/lisp/textmodes/sgml-mode-tests.el (sgml-tests--quotes-syntax): New test copied from master, with two cases added for this bug. --- test/lisp/textmodes/sgml-mode-tests.el | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test/lisp') diff --git a/test/lisp/textmodes/sgml-mode-tests.el b/test/lisp/textmodes/sgml-mode-tests.el index 7318a667b36..0000b352ff0 100644 --- a/test/lisp/textmodes/sgml-mode-tests.el +++ b/test/lisp/textmodes/sgml-mode-tests.el @@ -130,5 +130,27 @@ The point is set to the beginning of the buffer." (sgml-delete-tag 1) (should (string= "Winter is comin'" (buffer-string))))) +(ert-deftest sgml-tests--quotes-syntax () + (dolist (str '("a\"b c'd" + "a'b c\"d" + "\"a'" + "'a\"" + "\"a'\"" + "'a\"'" + "a\"b c'd" + ;;"c>'d" Fixed in master. + "" + "" + "(')" + "(\")" + )) + (with-temp-buffer + (sgml-mode) + (insert str) + (ert-info ((format "%S" str) :prefix "Test case: ") + ;; Check that last tag is parsed as a tag. + (should (= 1 (car (syntax-ppss (1- (point-max)))))) + (should (= 0 (car (syntax-ppss (point-max))))))))) + (provide 'sgml-mode-tests) ;;; sgml-mode-tests.el ends here -- cgit v1.2.1