comparison tests/automated/case-tests.el @ 4414:df576f30c1d8

Correct case-insensitive search for non-case, non-ASCII chars. Add tests. 2008-01-30 Aidan Kehoe <kehoea@parhasard.net> * automated/case-tests.el: Check for a bug Mike Sperber reported; check algorithms used, if available. 2008-01-30 Aidan Kehoe <kehoea@parhasard.net> * search.c (debug-xemacs-searches): New variable, available on debug builds. Used in tests/automated/case-tests.el. (search_buffer): Only store the charset_base for characters with translations. Correct some comments, correct some checks. If debug_xemacs_searches is non-zero, record which search was used. (boyer_moore): Remove an assertion that was incorrect. Remove its documentation. Correct an assertion dealing with equivalence tables; we may end up looking through the equivalence table if a non-ASCII non-case character was searched for.
author Aidan Kehoe <kehoea@parhasard.net>
date Wed, 30 Jan 2008 09:26:59 +0100
parents 0784d089fdc9
children bceb3e285ae7
comparison
equal deleted inserted replaced
4413:dc84ec90b463 4414:df576f30c1d8
266 (goto-char (point-max)) 266 (goto-char (point-max))
267 (Assert (eq 1 (search-backward string nil t 5))) 267 (Assert (eq 1 (search-backward string nil t 5)))
268 (goto-char (point-max)) 268 (goto-char (point-max))
269 (Assert (not (search-backward string nil t 6)))))) 269 (Assert (not (search-backward string nil t 6))))))
270 270
271 ;; Bug reported in http://mid.gmane.org/y9lk5lu5orq.fsf@deinprogramm.de from
272 ;; Michael Sperber. Fixed 2008-01-29.
273 (with-string-as-buffer-contents "\n\nDer beruhmte deutsche Flei\xdf\n\n"
274 (goto-char (point-min))
275 (Assert (search-forward "Flei\xdf")))
276
277 (Skip-Test-Unless
278 (boundp 'debug-xemacs-searches) ; normal when we have DEBUG_XEMACS
279 "not a DEBUG_XEMACS build"
280 (let ((debug-xemacs-searches 1))
281 (with-temp-buffer
282 (insert "\n\nDer beruhmte deutsche Fleiss\n\n")
283 (goto-char (point-min))
284 (search-forward "Fleiss")
285 (delete-region (point-min) (point-max))
286 (insert "\n\nDer beruhmte deutsche Flei\xdf\n\n")
287 (goto-char (point-min))
288 (search-forward "Flei\xdf")
289 (Assert (eq 'boyer-moore search-algorithm-used))
290 (delete-region (point-min) (point-max))
291 (when (featurep 'mule)
292 (insert "\n\nDer beruhmte deutsche Flei\xdf\n\n")
293 (goto-char (point-min))
294 (Assert
295 (search-forward (format "Fle%c\xdf"
296 (make-char 'latin-iso8859-9 #xfd))))
297 (Assert (eq 'boyer-moore search-algorithm-used))
298 (insert (make-char 'latin-iso8859-9 #xfd))
299 (goto-char (point-min))
300 (Assert
301 (search-forward (format "Fle%c\xdf"
302 (make-char 'latin-iso8859-9 #xfd))))
303 (Assert (eq 'simple-search search-algorithm-used))))))
304