comparison lisp/eshell/esh-test.el @ 111456:646142bd4c38

Replace some eshell functions that duplicate standard functions. * lisp/eshell/esh-util.el (eshell-time-less-p, eshell-time-to-seconds): Remove. (eshell-read-passwd, eshell-read-hosts): Use time-less-p. * lisp/eshell/esh-test.el (eshell-test, eshell-show-usage-metrics): * lisp/eshell/em-unix.el (eshell-show-elapsed-time, eshell/time): * lisp/eshell/em-pred.el (eshell-pred-file-time): Use float-time. * lisp/eshell/em-ls.el (eshell-ls-sort-entries): Use time-less-p.
author Glenn Morris <rgm@gnu.org>
date Tue, 09 Nov 2010 19:57:32 -0800
parents f57f72bb4757
children 417b1e4d63cd
comparison
equal deleted inserted replaced
111455:f21190964294 111456:646142bd4c38
148 148
149 ;;;###autoload 149 ;;;###autoload
150 (defun eshell-test (&optional arg) 150 (defun eshell-test (&optional arg)
151 "Test Eshell to verify that it works as expected." 151 "Test Eshell to verify that it works as expected."
152 (interactive "P") 152 (interactive "P")
153 (let* ((begin (eshell-time-to-seconds (current-time))) 153 (let* ((begin (float-time))
154 (test-buffer (get-buffer-create "*eshell test*"))) 154 (test-buffer (get-buffer-create "*eshell test*")))
155 (set-buffer (let ((inhibit-redisplay t)) 155 (set-buffer (let ((inhibit-redisplay t))
156 (save-window-excursion (eshell t)))) 156 (save-window-excursion (eshell t))))
157 (with-current-buffer test-buffer 157 (with-current-buffer test-buffer
158 (erase-buffer) 158 (erase-buffer)
174 (insert "\n")) 174 (insert "\n"))
175 (funcall (intern-soft funcname))) 175 (funcall (intern-soft funcname)))
176 (with-current-buffer test-buffer 176 (with-current-buffer test-buffer
177 (insert (format "\n\n--- %s --- (completed in %d seconds)\n" 177 (insert (format "\n\n--- %s --- (completed in %d seconds)\n"
178 (current-time-string) 178 (current-time-string)
179 (- (eshell-time-to-seconds (current-time)) 179 (- (float-time) begin)))
180 begin)))
181 (message "Eshell test suite completed: %s failure%s" 180 (message "Eshell test suite completed: %s failure%s"
182 (if (> eshell-test-failures 0) 181 (if (> eshell-test-failures 0)
183 (number-to-string eshell-test-failures) 182 (number-to-string eshell-test-failures)
184 "No") 183 "No")
185 (if (= eshell-test-failures 1) "" "s")))) 184 (if (= eshell-test-failures 1) "" "s"))))
221 (concat 220 (concat
222 (int-to-string 221 (int-to-string
223 (if (eq eshell-show-usage-metrics t) 222 (if (eq eshell-show-usage-metrics t)
224 (- eshell-metric-after-command 223 (- eshell-metric-after-command
225 eshell-metric-before-command 7) 224 eshell-metric-before-command 7)
226 (- (eshell-time-to-seconds 225 (- (float-time
227 eshell-metric-after-command) 226 eshell-metric-after-command)
228 (eshell-time-to-seconds 227 (float-time
229 eshell-metric-before-command)))) 228 eshell-metric-before-command))))
230 "\n")))) 229 "\n"))))
231 nil t)) 230 nil t))
232 231
233 (provide 'esh-test) 232 (provide 'esh-test)
234 233
235 ;; arch-tag: 6e32275a-8285-4a4e-b7cf-819aa7c86b8e
236 ;;; esh-test.el ends here 234 ;;; esh-test.el ends here