comparison tests/automated/regexp-tests.el @ 1425:74cb069b8417

[xemacs-hg @ 2003-04-23 15:42:44 by stephent] stale match data <87fzo99rje.fsf@tleepslib.sk.tsukuba.ac.jp> new split-string <87d6jd9qis.fsf@tleepslib.sk.tsukuba.ac.jp> support (info "(file)node") <87adeh9qa7.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Wed, 23 Apr 2003 15:42:52 +0000
parents aa15a2bbba1a
children 4c87ece1e837
comparison
equal deleted inserted replaced
1424:c35e2ad2f97d 1425:74cb069b8417
203 (Assert (string-match range-not string)))) 203 (Assert (string-match range-not string))))
204 (setq i (1+ i)))))) 204 (setq i (1+ i))))))
205 205
206 ;; (test-regex-charset-mule-paranoid) 206 ;; (test-regex-charset-mule-paranoid)
207 207
208 ;; Test replace-match 208 ;; Test that replace-match errors after a failed match
209 (with-temp-buffer 209 (with-temp-buffer
210 (insert "This is a test buffer.") 210 (insert "This is a test buffer.")
211 (goto-char (point-min)) 211 (goto-char (point-min))
212 (search-forward "this is a test ") 212 (search-forward "this is a test ")
213 (looking-at "Unmatchable text") 213 (looking-at "Unmatchable text")
214 (replace-match "") 214 (Check-Error args-out-of-range (replace-match "")))
215 (Assert (looking-at "^buffer.$")))
216 215
217 ;; Test that trivial regexps reset unused registers 216 ;; Test that trivial regexps reset unused registers
218 ;; Thanks to Martin Sternholm for the report. 217 ;; Thanks to Martin Sternholm for the report.
219 ;; xemacs-beta <5blm6h2ki5.fsf@lister.roxen.com> 218 ;; xemacs-beta <5blm6h2ki5.fsf@lister.roxen.com>
220 (with-temp-buffer 219 (with-temp-buffer
280 ) 279 )
281 ) 280 )
282 281
283 ;; More stale match data tests. 282 ;; More stale match data tests.
284 ;; Thanks to <bjacob@ca.metsci.com>. 283 ;; Thanks to <bjacob@ca.metsci.com>.
284 ;; These tests used to fail because we cleared match data only on success.
285 ;; Fixed 2003-04-17.
285 (Assert (not (progn (string-match "a" "a") 286 (Assert (not (progn (string-match "a" "a")
286 (string-match "b" "a") 287 (string-match "b" "a")
287 (match-string 0 "a")))) 288 (match-string 0 "a"))))
288 (Assert (not (progn (string-match "a" "a") 289 (Assert (not (progn (string-match "a" "a")
289 (string-match "b" "a") 290 (string-match "b" "a")