diff options
author | Glenn Morris <rgm@gnu.org> | 2014-11-17 13:39:56 -0500 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2014-11-17 13:39:56 -0500 |
commit | 83087df9492f4a16c835664aa39d0b8a7756d4bb (patch) | |
tree | 3a57348f8ec9ddedf5c9fd35e63710c4ae827baf /test | |
parent | 62243cb96f133581157f6eafa934b5b7ca4cc065 (diff) | |
download | emacs-83087df9492f4a16c835664aa39d0b8a7756d4bb.tar.gz |
Improve output of occur-tests in case of failure
* test/automated/occur-tests.el (occur-test-case, occur-test-create):
In case of failure, show the actual string, rather than just nil.
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/automated/occur-tests.el | 9 |
2 files changed, 9 insertions, 5 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 47bbfb36a10..42fcd8e934a 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2014-11-17 Glenn Morris <rgm@gnu.org> + + * automated/occur-tests.el (occur-test-case, occur-test-create): + In case of failure, show the actual string, rather than just nil. + 2014-11-17 Ulf Jasper <ulf.jasper@web.de> * automated/icalendar-tests.el (icalendar-tests--test-import): diff --git a/test/automated/occur-tests.el b/test/automated/occur-tests.el index b15e3dc9933..c00b71dd05f 100644 --- a/test/automated/occur-tests.el +++ b/test/automated/occur-tests.el @@ -321,7 +321,6 @@ Each element has the format: (let ((regexp (nth 0 test)) (nlines (nth 1 test)) (input-buffer-string (nth 2 test)) - (output-buffer-string (nth 3 test)) (temp-buffer (get-buffer-create " *test-occur*"))) (unwind-protect (save-window-excursion @@ -329,9 +328,8 @@ Each element has the format: (erase-buffer) (insert input-buffer-string) (occur regexp nlines) - (equal output-buffer-string - (with-current-buffer "*Occur*" - (buffer-string))))) + (with-current-buffer "*Occur*" + (buffer-substring-no-properties (point-min) (point-max))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) @@ -343,7 +341,8 @@ Each element has the format: `(ert-deftest ,testname () ,testdoc (let (occur-hook) - (should (occur-test-case (nth ,n occur-tests)))))))) + (should (equal (occur-test-case (nth ,n occur-tests)) + (nth 3 (nth ,n occur-tests))))))))) (dotimes (i (length occur-tests)) (occur-test-create i)) |