Mercurial > hg > xemacs-beta
changeset 4026:4d60c2708e5d
[xemacs-hg @ 2007-06-22 16:37:37 by stephent]
Tests for 'revert-buffer doesn't reset modiff' bug.
author | stephent |
---|---|
date | Fri, 22 Jun 2007 16:37:41 +0000 |
parents | f9a0570637f3 |
children | c56a675b3b05 |
files | tests/ChangeLog tests/automated/mule-tests.el |
diffstat | 2 files changed, 33 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/ChangeLog Fri Jun 22 00:21:17 2007 +0000 +++ b/tests/ChangeLog Fri Jun 22 16:37:41 2007 +0000 @@ -1,3 +1,7 @@ +2007-06-22 Stephen J. Turnbull <stephen@xemacs.org> + + * automated/mule-tests.el (buffer-modified-p): Test after revert. + 2007-06-21 Aidan Kehoe <kehoea@parhasard.net> * gtk/event-stream-tests.el (timer-check):
--- a/tests/automated/mule-tests.el Fri Jun 22 00:21:17 2007 +0000 +++ b/tests/automated/mule-tests.el Fri Jun 22 16:37:41 2007 +0000 @@ -112,6 +112,35 @@ ;; ochars[3] = 0x80 | input & ~(0xFFFFFFC0); (logior #x80 (logand code-point #x3f)))))))) +;;---------------------------------------------------------------- +;; 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. ;;-----------------------------------------------------------------