CVS update by stephent xemacs/tests/automated ...

xemacs-cvs at xemacs.org xemacs-cvs at xemacs.org
Fri Jun 22 12:37:41 EDT 2007


  User: stephent
  Date: 07/06/22 18:37:41

  Modified:    xemacs/tests/automated mule-tests.el
Log:
Tests for 'revert-buffer doesn't reset modiff' bug.

Revision  Changes    Path
1.94      +4 -0      XEmacs/xemacs/tests/ChangeLog

Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/tests/ChangeLog,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -p -r1.93 -r1.94
--- ChangeLog	2007/06/21 13:39:32	1.93
+++ ChangeLog	2007/06/22 16:37:37	1.94
@@ -1,3 +1,7 @@
+2007-06-22  Stephen J. Turnbull  <stephen at xemacs.org>
+
+	* automated/mule-tests.el (buffer-modified-p): Test after revert.
+
 2007-06-21  Aidan Kehoe  <kehoea at parhasard.net>
 
 	* gtk/event-stream-tests.el (timer-check):



1.19      +29 -0     XEmacs/xemacs/tests/automated/mule-tests.el

Index: mule-tests.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/tests/automated/mule-tests.el,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -p -r1.18 -r1.19
--- mule-tests.el	2007/05/21 08:11:37	1.18
+++ mule-tests.el	2007/06/22 16:37:41	1.19
@@ -112,6 +112,35 @@ This is a naive implementation in Lisp. 
 		    ;; 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 at xemacs.org>.
+;; Fixed 2007-06-22 <18043.2793.611745.734215 at 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.
 ;;-----------------------------------------------------------------





More information about the XEmacs-CVS mailing list