comparison tests/automated/mule-tests.el @ 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 d76663859e32
children 5b55fa103aa1
comparison
equal deleted inserted replaced
4025:f9a0570637f3 4026:4d60c2708e5d
109 (logior #x80 (logand (lsh code-point -12) #x3f)) 109 (logior #x80 (logand (lsh code-point -12) #x3f))
110 ;; ochars[2] = 0x80 | (input >> 6) & ~(0xFFFFFFC0); 110 ;; ochars[2] = 0x80 | (input >> 6) & ~(0xFFFFFFC0);
111 (logior #x80 (logand (lsh code-point -6) #x3f)) 111 (logior #x80 (logand (lsh code-point -6) #x3f))
112 ;; ochars[3] = 0x80 | input & ~(0xFFFFFFC0); 112 ;; ochars[3] = 0x80 | input & ~(0xFFFFFFC0);
113 (logior #x80 (logand code-point #x3f)))))))) 113 (logior #x80 (logand code-point #x3f))))))))
114
115 ;;----------------------------------------------------------------
116 ;; Test that revert-buffer resets the modiff
117 ;; Bug reported 2007-06-20 <200706201902.32191.scop@xemacs.org>.
118 ;; Fixed 2007-06-22 <18043.2793.611745.734215@parhasard.net>.
119 ;;----------------------------------------------------------------
120
121 ;; #### need a temp file name but this will do for now
122 (let ((test-file-name (expand-file-name "~/test-revert-buffer-resets-modiff"))
123 revert-buffer-function
124 kill-buffer-hook) ; paranoia
125 (find-file test-file-name)
126 (erase-buffer)
127 (insert "a string\n")
128 (save-buffer 0)
129 (insert "more text\n")
130 (revert-buffer t t)
131 ;; Just "find-file" with autodetect coding didn't fail for me, but it does
132 ;; fail under test harness. Still we'll redo the test with an explicit
133 ;; coding system just in case.
134 (Assert (not (buffer-modified-p)))
135 (kill-buffer nil)
136 (when (find-coding-system 'utf-8)
137 (find-file test-file-name 'utf-8)
138 (insert "more text\n")
139 (revert-buffer t t)
140 (Assert (not (buffer-modified-p)))
141 (kill-buffer nil))
142 (delete-file test-file-name))
114 143
115 ;;----------------------------------------------------------------- 144 ;;-----------------------------------------------------------------
116 ;; Test string modification functions that modify the length of a char. 145 ;; Test string modification functions that modify the length of a char.
117 ;;----------------------------------------------------------------- 146 ;;-----------------------------------------------------------------
118 147