diff options
| author | Glenn Morris | 2014-11-17 13:39:56 -0500 |
|---|---|---|
| committer | Glenn Morris | 2014-11-17 13:39:56 -0500 |
| commit | 83087df9492f4a16c835664aa39d0b8a7756d4bb (patch) | |
| tree | 3a57348f8ec9ddedf5c9fd35e63710c4ae827baf /test | |
| parent | 62243cb96f133581157f6eafa934b5b7ca4cc065 (diff) | |
| download | emacs-83087df9492f4a16c835664aa39d0b8a7756d4bb.tar.gz emacs-83087df9492f4a16c835664aa39d0b8a7756d4bb.zip | |
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 @@ | |||
| 1 | 2014-11-17 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * automated/occur-tests.el (occur-test-case, occur-test-create): | ||
| 4 | In case of failure, show the actual string, rather than just nil. | ||
| 5 | |||
| 1 | 2014-11-17 Ulf Jasper <ulf.jasper@web.de> | 6 | 2014-11-17 Ulf Jasper <ulf.jasper@web.de> |
| 2 | 7 | ||
| 3 | * automated/icalendar-tests.el (icalendar-tests--test-import): | 8 | * 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: | |||
| 321 | (let ((regexp (nth 0 test)) | 321 | (let ((regexp (nth 0 test)) |
| 322 | (nlines (nth 1 test)) | 322 | (nlines (nth 1 test)) |
| 323 | (input-buffer-string (nth 2 test)) | 323 | (input-buffer-string (nth 2 test)) |
| 324 | (output-buffer-string (nth 3 test)) | ||
| 325 | (temp-buffer (get-buffer-create " *test-occur*"))) | 324 | (temp-buffer (get-buffer-create " *test-occur*"))) |
| 326 | (unwind-protect | 325 | (unwind-protect |
| 327 | (save-window-excursion | 326 | (save-window-excursion |
| @@ -329,9 +328,8 @@ Each element has the format: | |||
| 329 | (erase-buffer) | 328 | (erase-buffer) |
| 330 | (insert input-buffer-string) | 329 | (insert input-buffer-string) |
| 331 | (occur regexp nlines) | 330 | (occur regexp nlines) |
| 332 | (equal output-buffer-string | 331 | (with-current-buffer "*Occur*" |
| 333 | (with-current-buffer "*Occur*" | 332 | (buffer-substring-no-properties (point-min) (point-max))))) |
| 334 | (buffer-string))))) | ||
| 335 | (and (buffer-name temp-buffer) | 333 | (and (buffer-name temp-buffer) |
| 336 | (kill-buffer temp-buffer))))) | 334 | (kill-buffer temp-buffer))))) |
| 337 | 335 | ||
| @@ -343,7 +341,8 @@ Each element has the format: | |||
| 343 | `(ert-deftest ,testname () | 341 | `(ert-deftest ,testname () |
| 344 | ,testdoc | 342 | ,testdoc |
| 345 | (let (occur-hook) | 343 | (let (occur-hook) |
| 346 | (should (occur-test-case (nth ,n occur-tests)))))))) | 344 | (should (equal (occur-test-case (nth ,n occur-tests)) |
| 345 | (nth 3 (nth ,n occur-tests))))))))) | ||
| 347 | 346 | ||
| 348 | (dotimes (i (length occur-tests)) | 347 | (dotimes (i (length occur-tests)) |
| 349 | (occur-test-create i)) | 348 | (occur-test-create i)) |