From: Ulf Jasper Date: Sat, 26 Jul 2014 12:53:36 +0000 (+0200) Subject: Work around the failures in icalendar-tests which occasionally occur X-Git-Tag: emacs-25.0.90~2636^3~38 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=54e3f15626296c1ece932852df2b3d4938b0b44a;p=emacs.git Work around the failures in icalendar-tests which occasionally occur on hydra.nixos.org. * automated/icalendar-tests.el (icalendar-tests--do-test-import): Work around the failures in icalendar-tests which occasionally occur on hydra.nixos.org. --- diff --git a/test/ChangeLog b/test/ChangeLog index c66ea1c739f..6afa9ea8959 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2014-07-26 Ulf Jasper + + * automated/icalendar-tests.el (icalendar-tests--do-test-import): + Work around the failures in icalendar-tests which occasionally occur on + hydra.nixos.org. + 2014-07-21 Fabián Ezequiel Gallina * automated/python-tests.el: diff --git a/test/automated/icalendar-tests.el b/test/automated/icalendar-tests.el index b921853c4aa..7b51f907d38 100644 --- a/test/automated/icalendar-tests.el +++ b/test/automated/icalendar-tests.el @@ -718,11 +718,34 @@ Argument EXPECTED-AMERICAN expected american style diary string." Argument INPUT input icalendar string. Argument EXPECTED-OUTPUT expected diary string." (let ((temp-file (make-temp-file "icalendar-test-diary"))) + ;; Test the Catch-the-mysterious-coding-header logic below. + ;; Ruby-mode adds an after-save-hook which inserts the header! + ;; (save-excursion + ;; (find-file temp-file) + ;; (ruby-mode)) (icalendar-import-buffer temp-file t t) (save-excursion (find-file temp-file) + ;; Check for the mysterious "# coding: ..." header, remove it + ;; and give a shout + (goto-char (point-min)) + (when (re-search-forward "# coding: .*?\n" nil t) + (message (concat "%s\n" + "Found mysterious \"# coding ...\" header! Removing it.\n" + "Current Modes: %s, %s\n" + "Current test: %s\n" + "%s") + (make-string 70 ?*) + major-mode + minor-mode-list + (ert-running-test) + (make-string 70 ?*)) + (buffer-disable-undo) + (replace-match "") + (set-buffer-modified-p nil)) + (let ((result (buffer-substring-no-properties (point-min) (point-max)))) - (should (string= expected-output result))) + (should (string= expected-output result))) (kill-buffer (find-buffer-visiting temp-file)) (delete-file temp-file))))