From ca2e9fb3064d0891c5143ba52c220f2c99be7273 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 19 Apr 2014 23:05:30 +0200 Subject: Instrument `tramp--test-check-files' in order to get traces on hydra. --- test/automated/tramp-tests.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el index 607718412fd..2572f9c82e4 100644 --- a/test/automated/tramp-tests.el +++ b/test/automated/tramp-tests.el @@ -1418,6 +1418,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (defun tramp--test-check-files (&rest files) "Runs a simple but comprehensive test over every file in FILES." + (tramp--instrument-test-case 10 (let ((tmp-name1 (tramp--test-make-temp-name)) (tmp-name2 (tramp--test-make-temp-name 'local))) (unwind-protect @@ -1448,7 +1449,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." tmp-name2 nil directory-files-no-dot-files-regexp) (sort (copy-sequence files) 'string-lessp)))) (ignore-errors (delete-directory tmp-name1 'recursive)) - (ignore-errors (delete-directory tmp-name2 'recursive))))) + (ignore-errors (delete-directory tmp-name2 'recursive)))))) ;; This test is inspired by Bug#17238. (ert-deftest tramp-test30-special-characters () -- cgit v1.3 From f3a4812cf2fe0facbda57bee0810cf23f1c96fa2 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 20 Apr 2014 23:39:43 +0200 Subject: * automated/tramp-tests.el (tramp-test19-directory-files-and-attributes) (tramp-test22-file-times): Check for `file-attributes' equality only if there is a usable timestamp. (tramp--test-check-files): Do not use `copy-sequence'. --- test/ChangeLog | 8 ++++++++ test/automated/tramp-tests.el | 40 ++++++++++++++++++++++++---------------- 2 files changed, 32 insertions(+), 16 deletions(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index d677d13db44..0a9872ba1db 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,11 @@ +2014-04-20 Michael Albinus + + * automated/tramp-tests.el + (tramp-test19-directory-files-and-attributes) + (tramp-test22-file-times): Check for `file-attributes' equality + only if there is a usable timestamp. + (tramp--test-check-files): Do not use `copy-sequence'. + 2014-04-19 Michael Albinus * automated/tramp-tests.el (tramp--test-check-files): Extend test. diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el index 2572f9c82e4..f5ba59a02b6 100644 --- a/test/automated/tramp-tests.el +++ b/test/automated/tramp-tests.el @@ -1012,14 +1012,22 @@ This tests also `file-readable-p' and `file-regular-p'." (write-region "boz" nil (expand-file-name "boz" tmp-name2)) (setq attr (directory-files-and-attributes tmp-name2)) (should (consp attr)) + ;; Dumb remote shells without perl(1) or stat(1) are not + ;; able to return the date correctly. They say "don't know". (dolist (elt attr) - (should - (equal (file-attributes (expand-file-name (car elt) tmp-name2)) - (cdr elt)))) + (unless + (equal + (nth 5 + (file-attributes (expand-file-name (car elt) tmp-name2))) + '(0 0)) + (should + (equal (file-attributes (expand-file-name (car elt) tmp-name2)) + (cdr elt))))) (setq attr (directory-files-and-attributes tmp-name2 'full)) (dolist (elt attr) - (should - (equal (file-attributes (car elt)) (cdr elt)))) + (unless (equal (nth 5 (file-attributes (car elt))) '(0 0)) + (should + (equal (file-attributes (car elt)) (cdr elt))))) (setq attr (directory-files-and-attributes tmp-name2 nil "^b")) (should (equal (mapcar 'car attr) '("bar" "boz")))) (ignore-errors (delete-directory tmp-name1 'recursive))))) @@ -1142,16 +1150,16 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." ;; We skip the test, if the remote handler is not able to ;; set the correct time. (skip-unless (set-file-times tmp-name1 '(0 1))) - ;; Dumb busyboxes are not able to return the date correctly. - ;; They say "don't know. - (skip-unless (not (equal (nth 5 (file-attributes tmp-name1)) '(0 0)))) - (should (equal (nth 5 (file-attributes tmp-name1)) '(0 1))) - (write-region "bla" nil tmp-name2) - (should (file-exists-p tmp-name2)) - (should (file-newer-than-file-p tmp-name2 tmp-name1)) - ;; `tmp-name3' does not exist. - (should (file-newer-than-file-p tmp-name2 tmp-name3)) - (should-not (file-newer-than-file-p tmp-name3 tmp-name1))) + ;; Dumb remote shells without perl(1) or stat(1) are not + ;; able to return the date correctly. They say "don't know". + (unless (equal (nth 5 (file-attributes tmp-name1)) '(0 0)) + (should (equal (nth 5 (file-attributes tmp-name1)) '(0 1))) + (write-region "bla" nil tmp-name2) + (should (file-exists-p tmp-name2)) + (should (file-newer-than-file-p tmp-name2 tmp-name1)) + ;; `tmp-name3' does not exist. + (should (file-newer-than-file-p tmp-name2 tmp-name3)) + (should-not (file-newer-than-file-p tmp-name3 tmp-name1)))) (ignore-errors (delete-file tmp-name1) (delete-file tmp-name2))))) @@ -1447,7 +1455,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (sort (copy-sequence files) 'string-lessp))) (should (equal (directory-files tmp-name2 nil directory-files-no-dot-files-regexp) - (sort (copy-sequence files) 'string-lessp)))) + (sort files 'string-lessp)))) (ignore-errors (delete-directory tmp-name1 'recursive)) (ignore-errors (delete-directory tmp-name2 'recursive)))))) -- cgit v1.3 From 622eef687cedb8fbaf8ca529239f46968c2487f7 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 21 Apr 2014 17:18:12 -0400 Subject: * lisp/emacs-lisp/cl-macs.el (cl--loop-let): Avoid `nil' as var name. --- lisp/ChangeLog | 8 ++++++-- lisp/emacs-lisp/cl-macs.el | 6 ++++-- test/automated/cl-lib.el | 3 +++ 3 files changed, 13 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c1aef0c0f90..d25bf4b7597 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,11 @@ +2014-04-21 Stefan Monnier + + * emacs-lisp/cl-macs.el (cl--loop-let): Avoid `nil' as var name. + 2014-04-21 Michael Albinus - * net/tramp-sh.el (tramp-sh-handle-file-name-all-completions): Set - "IFS=" when using read builtin, in order to preserve spaces in + * net/tramp-sh.el (tramp-sh-handle-file-name-all-completions): + Set "IFS=" when using read builtin, in order to preserve spaces in the file name. Add test messages for hunting a bug on hydra. (tramp-get-ls-command): Undo using "-b" argument. It doesn't help. diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index cd2d52a4b21..1c163273b64 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -1542,12 +1542,14 @@ If BODY is `setq', then use SPECS for assignments rather than for bindings." (if (and (cl--unused-var-p temp) (null expr)) nil ;; Don't bother declaring/setting `temp' since it won't ;; be used when `expr' is nil, anyway. - (when (and (eq body 'setq) (cl--unused-var-p temp)) + (when (or (null temp) + (and (eq body 'setq) (cl--unused-var-p temp))) ;; Prefer a fresh uninterned symbol over "_to", to avoid ;; warnings that we set an unused variable. (setq temp (make-symbol "--cl-var--")) ;; Make sure this temp variable is locally declared. - (push (list (list temp)) cl--loop-bindings)) + (when (eq body 'setq) + (push (list (list temp)) cl--loop-bindings))) (push (list temp expr) new)) (while (consp spec) (push (list (pop spec) diff --git a/test/automated/cl-lib.el b/test/automated/cl-lib.el index f7f4314e1cb..0587bf92b7c 100644 --- a/test/automated/cl-lib.el +++ b/test/automated/cl-lib.el @@ -195,6 +195,9 @@ (should (eql (cl-mismatch "Aa" "aA") 0)) (should (eql (cl-mismatch '(a b c) '(a b d)) 2))) +(ert-deftest cl-lib-test-loop () + (should (eql (cl-loop with (a b c) = '(1 2 3) return (+ a b c)) 6))) + (ert-deftest cl-lib-keyword-names-versus-values () (should (equal (funcall (cl-function (lambda (&key a b) (list a b))) -- cgit v1.3 From 84b2095cba06265caac7290b1ec10b1d4cc52745 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 22 Apr 2014 09:50:58 +0200 Subject: * automated/tramp-tests.el (tramp-test30-special-characters): Remove test for backslash. --- test/ChangeLog | 5 +++++ test/automated/tramp-tests.el | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 0a9872ba1db..cf42099e3d3 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2014-04-22 Michael Albinus + + * automated/tramp-tests.el (tramp-test30-special-characters): + Remove test for backslash. + 2014-04-20 Michael Albinus * automated/tramp-tests.el diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el index f5ba59a02b6..372b00de35a 100644 --- a/test/automated/tramp-tests.el +++ b/test/automated/tramp-tests.el @@ -1464,9 +1464,10 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." "Check special characters in file names." (skip-unless (tramp--test-enabled)) - ;; Newlines and slashes in file names are not supported. So we don't test. + ;; Newlines, slashes and backslashes in file names are not supported. + ;; So we don't test. (tramp--test-check-files - " foo bar\tbaz " + " foo\tbar baz\t" "$foo$bar$$baz$" "-foo-bar-baz-" "%foo%bar%baz%" @@ -1474,7 +1475,6 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." "?foo?bar?baz?" "*foo*bar*baz*" "'foo\"bar'baz\"" - "\\foo\\bar\\baz\\" "#foo#bar#baz#" "!foo|bar!baz|" ":foo;bar:baz;" -- cgit v1.3 From d5ff4ded7a225306017006fc96b0a30180ae6f6b Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 22 Apr 2014 12:52:08 +0200 Subject: * automated/tramp-tests.el (tramp--test-check-files): Remove traces. --- test/ChangeLog | 4 ++-- test/automated/tramp-tests.el | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index cf42099e3d3..d21f24ff1e8 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,7 +1,7 @@ 2014-04-22 Michael Albinus - * automated/tramp-tests.el (tramp-test30-special-characters): - Remove test for backslash. + * automated/tramp-tests.el (tramp--test-check-files): Remove traces. + (tramp-test30-special-characters): Remove test for backslash. 2014-04-20 Michael Albinus diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el index 372b00de35a..b6e757d3ae5 100644 --- a/test/automated/tramp-tests.el +++ b/test/automated/tramp-tests.el @@ -1426,7 +1426,6 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (defun tramp--test-check-files (&rest files) "Runs a simple but comprehensive test over every file in FILES." - (tramp--instrument-test-case 10 (let ((tmp-name1 (tramp--test-make-temp-name)) (tmp-name2 (tramp--test-make-temp-name 'local))) (unwind-protect @@ -1457,7 +1456,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." tmp-name2 nil directory-files-no-dot-files-regexp) (sort files 'string-lessp)))) (ignore-errors (delete-directory tmp-name1 'recursive)) - (ignore-errors (delete-directory tmp-name2 'recursive)))))) + (ignore-errors (delete-directory tmp-name2 'recursive))))) ;; This test is inspired by Bug#17238. (ert-deftest tramp-test30-special-characters () -- cgit v1.3