X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=tests%2Fautomated%2Fmule-tests.el;h=4001f1b8e6c9991af6b175fe16a4d0186ebc2d3b;hb=1a598a84ea467f215ccb6946f35665641512f911;hp=ab905161df3a80fe98c0eb41b2c5f489eb6cb7d3;hpb=a44bbbfd0a7d2ff5a023d0448d65fe338384a7fc;p=chise%2Fxemacs-chise.git.1 diff --git a/tests/automated/mule-tests.el b/tests/automated/mule-tests.el index ab90516..4001f1b 100644 --- a/tests/automated/mule-tests.el +++ b/tests/automated/mule-tests.el @@ -78,6 +78,35 @@ the Assert macro checks for correctness." ;; once compiled, for no good reason. (test-chars t) +;;---------------------------------------------------------------- +;; Test that revert-buffer resets the modiff +;; Bug reported 2007-06-20 <200706201902.32191.scop@xemacs.org>. +;; Fixed 2007-06-22 <18043.2793.611745.734215@parhasard.net>. +;;---------------------------------------------------------------- + +;; #### need a temp file name but this will do for now +(let ((test-file-name (expand-file-name "~/test-revert-buffer-resets-modiff")) + revert-buffer-function + kill-buffer-hook) ; paranoia + (find-file test-file-name) + (erase-buffer) + (insert "a string\n") + (save-buffer 0) + (insert "more text\n") + (revert-buffer t t) + ;; Just "find-file" with autodetect coding didn't fail for me, but it does + ;; fail under test harness. Still we'll redo the test with an explicit + ;; coding system just in case. + (Assert (not (buffer-modified-p))) + (kill-buffer nil) + (when (find-coding-system 'utf-8) + (find-file test-file-name 'utf-8) + (insert "more text\n") + (revert-buffer t t) + (Assert (not (buffer-modified-p))) + (kill-buffer nil)) + (delete-file test-file-name)) + ;;----------------------------------------------------------------- ;; Test string modification functions that modify the length of a char. ;;----------------------------------------------------------------- @@ -301,8 +330,7 @@ the Assert macro checks for correctness." (name1 (make-temp-name prefix)) (name2 (make-temp-name prefix)) (file-name-coding-system 'iso-8859-2)) - ;; This is how you suppress output from `message', called by `write-region' - (flet ((append-message (&rest args) ())) + (Silence-Message (Assert (not (equal name1 name2))) ;; Kludge to handle Mac OS X which groks only UTF-8. (cond ((eq system-type 'darwin)