comparison tests/automated/regexp-tests.el @ 1175:2af1f88a2d31

[xemacs-hg @ 2002-12-27 06:13:13 by stephent] mule re tests <87el84sru1.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Fri, 27 Dec 2002 06:15:01 +0000
parents 0d33547d9ed3
children dff007bd492b
comparison
equal deleted inserted replaced
1174:517c19223b40 1175:2af1f88a2d31
219 ;; xemacs-beta <5blm6h2ki5.fsf@lister.roxen.com> 219 ;; xemacs-beta <5blm6h2ki5.fsf@lister.roxen.com>
220 (with-temp-buffer 220 (with-temp-buffer
221 (insert "ab") 221 (insert "ab")
222 (goto-char (point-min)) 222 (goto-char (point-min))
223 (re-search-forward "\\(a\\)") 223 (re-search-forward "\\(a\\)")
224 ;; test the whole-match data, too -- one try scotched that, too! 224 ;; test the whole-match data, too -- one attempted fix scotched that, too!
225 (Assert (string= (match-string 0) "a")) 225 (Assert (string= (match-string 0) "a"))
226 (Assert (string= (match-string 1) "a")) 226 (Assert (string= (match-string 1) "a"))
227 (re-search-forward "b") 227 (re-search-forward "b")
228 (Assert (string= (match-string 0) "b")) 228 (Assert (string= (match-string 0) "b"))
229 (Assert (string= (match-string 1) nil))) 229 (Assert (string= (match-string 1) nil)))
247 (Assert (not (string-match "\\>" ""))) 247 (Assert (not (string-match "\\>" "")))
248 (Assert (not (string-match " \\<" " "))) 248 (Assert (not (string-match " \\<" " ")))
249 (Assert (not (string-match "\\> " " "))) 249 (Assert (not (string-match "\\> " " ")))
250 (Assert (not (string-match "a\\<" "a"))) 250 (Assert (not (string-match "a\\<" "a")))
251 (Assert (not (string-match "\\>a" "a"))) 251 (Assert (not (string-match "\\>a" "a")))
252 ;; Added Known-Bug 2002-09-09
252 (Known-Bug-Expect-Failure 253 (Known-Bug-Expect-Failure
253 (Assert (not (string-match "\\b" ""))) 254 (Assert (not (string-match "\\b" "")))
254 (Assert (not (string-match "\\b" " "))) 255 (Assert (not (string-match "\\b" " ")))
255 (Assert (not (string-match " \\b" " "))) 256 (Assert (not (string-match " \\b" " ")))
256 (Assert (not (string-match "\\b " " ")))) 257 (Assert (not (string-match "\\b " " "))))
258
259 ;; Character classes are broken in Mule as of 21.5.9
260 ;; Added Known-Bug 2002-12-27
261 (if (featurep 'mule)
262 ;; note: (int-to-char 65) => ?A
263 (let ((ch0 (make-char 'japanese-jisx0208 52 65))
264 (ch1 (make-char 'japanese-jisx0208 51 65)))
265 (Assert (not (string-match "A" (string ch0))))
266 (Assert (not (string-match "[A]" (string ch0))))
267 (Known-Bug-Expect-Failure
268 (Assert (eq (string-match "[^A]" (string ch0)) 0)))
269 (Assert (not (string-match "@A" (string ?@ ch0))))
270 (Known-Bug-Expect-Failure
271 (Assert (not (string-match "@[A]" (string ?@ ch0)))))
272 (Known-Bug-Expect-Failure
273 (Assert (eq (string-match "@[^A]" (string ?@ ch0)) 0)))
274 (Assert (not (string-match "@?A" (string ?@ ch0))))
275 (Assert (not (string-match "A" (string ch1))))
276 (Assert (not (string-match "[A]" (string ch1))))
277 (Assert (eq (string-match "[^A]" (string ch1)) 0))
278 (Assert (not (string-match "@A" (string ?@ ch1))))
279 (Assert (not (string-match "@[A]" (string ?@ ch1))))
280 (Assert (eq (string-match "@[^A]" (string ?@ ch1)) 0))
281 (Assert (not (string-match "@?A" (string ?@ ch1))))))