comparison tests/automated/regexp-tests.el @ 4897:91a023144e72

fix longstanding search bug involving searching for Control-1 chars -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2010-01-29 Ben Wing <ben@xemacs.org> * search.c (boyer_moore): Fix longstanding bug involving searching for Control-1 chars; code was trying to directly extract the last byte in the textual representation of a char from an Ichar (and doing it in a buggy fashion) rather than just converting the Ichar to text and looking at the last byte. tests/ChangeLog addition: 2010-01-29 Ben Wing <ben@xemacs.org> * automated/search-tests.el: New file. * automated/search-tests.el: * automated/case-tests.el: * automated/case-tests.el (pristine-case-table): Removed. * automated/case-tests.el (uni-mappings): * automated/lisp-tests.el: * automated/regexp-tests.el: Extract some search-related code from case-tests and regexp-tests and move to search-tests. Move some regexp-related code from lisp-tests to regexp-tests. Write a comment trying to express the proper division of labor between case-tests, search-tests and regexp-tests. Add a new test for the Control-1 search bug. Fix a buggy test in the Unicode torture-test section of case-tests.el.
author Ben Wing <ben@xemacs.org>
date Fri, 29 Jan 2010 20:57:42 -0600
parents 189fb67ca31a
children 0eccfd4850d6
comparison
equal deleted inserted replaced
4896:a7ab1d6ff301 4897:91a023144e72
26 26
27 ;;; Synched up with: Not in FSF. 27 ;;; Synched up with: Not in FSF.
28 28
29 ;;; Commentary: 29 ;;; Commentary:
30 30
31 ;; Test regular expression. 31 ;; Test regular expressions.
32
33 ;; NOTE NOTE NOTE: There is some domain overlap among regexp-tests.el,
34 ;; search-tests.el and case-tests.el. See search-tests.el.
35 ;;
32 36
33 (Check-Error-Message error "Trailing backslash" 37 (Check-Error-Message error "Trailing backslash"
34 (string-match "\\" "a")) 38 (string-match "\\" "a"))
35 (Check-Error-Message error "Invalid preceding regular expression" 39 (Check-Error-Message error "Invalid preceding regular expression"
36 (string-match "a++" "a")) 40 (string-match "a++" "a"))
561 (forward-char 1) 565 (forward-char 1)
562 (Assert (looking-at "\\=")) 566 (Assert (looking-at "\\="))
563 (Assert= (re-search-forward "\\=") 4)) 567 (Assert= (re-search-forward "\\=") 4))
564 568
565 569
570 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
571 ;; Tests involving case-changing replace-match ;;
572 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
573
574 (Assert (not (string-match "\\(\\.\\=\\)" ".")))
575 (Assert (string= "" (let ((str "test string"))
576 (if (string-match "^.*$" str)
577 (replace-match "\\U" t nil str)))))
578 (with-temp-buffer
579 (erase-buffer)
580 (insert "test string")
581 (re-search-backward "^.*$")
582 (replace-match "\\U" t)
583 (Assert (and (bobp) (eobp))))
584