aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorStephen Berman2017-08-02 17:25:44 +0200
committerStephen Berman2017-08-02 17:25:44 +0200
commit61291201039fa23096a895cb0cb724d35b7b4ed4 (patch)
tree6d90f6cd5f8539eb3a37f0c01e1372b383f4158d /test
parentcf1da46761675f1886e54765fa213c7bd7d93437 (diff)
downloademacs-61291201039fa23096a895cb0cb724d35b7b4ed4.tar.gz
emacs-61291201039fa23096a895cb0cb724d35b7b4ed4.zip
Add debugging messages to a Dired test
* test/lisp/dired-tests.el (dired-test-bug27243-01): Log positions saved and restored by dired-revert to try and find out why the test fails on Hydra.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/dired-tests.el12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el
index c67f37953ca..1ae47a92f83 100644
--- a/test/lisp/dired-tests.el
+++ b/test/lisp/dired-tests.el
@@ -122,8 +122,11 @@
122 122
123(ert-deftest dired-test-bug27243-01 () 123(ert-deftest dired-test-bug27243-01 ()
124 "Test for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27243#5 ." 124 "Test for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27243#5 ."
125 (let ((test-dir (file-name-as-directory (make-temp-file "test-dir-" t))) 125 (let* ((test-dir (file-name-as-directory (make-temp-file "test-dir-" t)))
126 (dired-auto-revert-buffer t) buffers) 126 (save-pos (lambda ()
127 (with-current-buffer (car (dired-buffers-for-dir test-dir))
128 (dired-save-positions))))
129 (dired-auto-revert-buffer t) buffers)
127 ;; On MS-Windows, get rid of 8+3 short names in test-dir, if the 130 ;; On MS-Windows, get rid of 8+3 short names in test-dir, if the
128 ;; corresponding long file names exist, otherwise such names trip 131 ;; corresponding long file names exist, otherwise such names trip
129 ;; dired-buffers-for-dir. 132 ;; dired-buffers-for-dir.
@@ -132,10 +135,12 @@
132 (should-not (dired-buffers-for-dir test-dir)) 135 (should-not (dired-buffers-for-dir test-dir))
133 (with-current-buffer (find-file-noselect test-dir) 136 (with-current-buffer (find-file-noselect test-dir)
134 (make-directory "test-subdir")) 137 (make-directory "test-subdir"))
138 (message "Saved pos: %S" (funcall save-pos))
135 ;; Point must be at end-of-buffer. 139 ;; Point must be at end-of-buffer.
136 (with-current-buffer (car (dired-buffers-for-dir test-dir)) 140 (with-current-buffer (car (dired-buffers-for-dir test-dir))
137 (should (eobp))) 141 (should (eobp)))
138 (push (dired test-dir) buffers) 142 (push (dired test-dir) buffers)
143 (message "Saved pos: %S" (funcall save-pos))
139 ;; Previous dired call shouldn't create a new buffer: must visit the one 144 ;; Previous dired call shouldn't create a new buffer: must visit the one
140 ;; created by `find-file-noselect' above. 145 ;; created by `find-file-noselect' above.
141 (should (eq 1 (length (dired-buffers-for-dir test-dir)))) 146 (should (eq 1 (length (dired-buffers-for-dir test-dir))))
@@ -144,10 +149,13 @@
144 (pt1 (point)) 149 (pt1 (point))
145 (test-file (concat (file-name-as-directory "test-subdir") 150 (test-file (concat (file-name-as-directory "test-subdir")
146 "test-file"))) 151 "test-file")))
152 (message "Saved pos: %S" (funcall save-pos))
147 (write-region "Test" nil test-file nil 'silent nil 'excl) 153 (write-region "Test" nil test-file nil 'silent nil 'excl)
154 (message "Saved pos: %S" (funcall save-pos))
148 ;; Sanity check: point should now be on the subdirectory. 155 ;; Sanity check: point should now be on the subdirectory.
149 (should (equal (dired-file-name-at-point) 156 (should (equal (dired-file-name-at-point)
150 (concat test-dir (file-name-as-directory "test-subdir")))) 157 (concat test-dir (file-name-as-directory "test-subdir"))))
158 (message "Saved pos: %S" (funcall save-pos))
151 (push (dired-find-file) buffers) 159 (push (dired-find-file) buffers)
152 (let ((pt2 (point))) ; Point is on test-file. 160 (let ((pt2 (point))) ; Point is on test-file.
153 (pop-to-buffer-same-window buf) 161 (pop-to-buffer-same-window buf)