comparison tests/automated/regexp-tests.el @ 1095:0d33547d9ed3

[xemacs-hg @ 2002-11-11 15:39:03 by stephent] testing improvements <87adkgyv5v.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Mon, 11 Nov 2002 15:39:07 +0000
parents ccaf90c5a53a
children 2af1f88a2d31
comparison
equal deleted inserted replaced
1094:4f4c898836ab 1095:0d33547d9ed3
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)))
230 230
231 ;; Test word boundaries 231 ;; Test word boundaries
232 (Assert (= (string-match " \\<a" " a") 0)) 232 (Assert (= (string-match "\\<a" " a") 1))
233 (Assert (= (string-match "a\\> " "a ") 0)) 233 (Assert (= (string-match "a\\>" "a ") 0))
234 (Assert (= (string-match " \\ba" " a") 0))
235 (Assert (= (string-match "a\\b " "a ") 0))
236 (Assert (= (string-match "\\ba" " a") 1)) 234 (Assert (= (string-match "\\ba" " a") 1))
237 (Assert (= (string-match "a\\b" "a ") 0)) 235 (Assert (= (string-match "a\\b" "a ") 0))
238 ;; should work at target boundaries 236 ;; should work at target boundaries
239 (Assert (= (string-match "\\<a" "a") 0)) 237 (Assert (= (string-match "\\<a" "a") 0))
240 (Assert (= (string-match "a\\>" "a") 0)) 238 (Assert (= (string-match "a\\>" "a") 0))
241 (Assert (= (string-match "\\ba" "a") 0)) 239 (Assert (= (string-match "\\ba" "a") 0))
242 (Assert (= (string-match "a\\b" "a") 0)) 240 (Assert (= (string-match "a\\b" "a") 0))
241 ;; Check for weirdness
242 (Assert (not (string-match " \\> " " ")))
243 (Assert (not (string-match " \\< " " ")))
244 (Assert (not (string-match " \\b " " ")))
243 ;; but not if the "word" would be on the null side of the boundary! 245 ;; but not if the "word" would be on the null side of the boundary!
244 (Assert (not (string-match "\\<" ""))) 246 (Assert (not (string-match "\\<" "")))
245 (Assert (not (string-match "\\>" ""))) 247 (Assert (not (string-match "\\>" "")))
246 (Assert (not (string-match " \\<" " "))) 248 (Assert (not (string-match " \\<" " ")))
247 (Assert (not (string-match "\\> " " "))) 249 (Assert (not (string-match "\\> " " ")))
248 (Assert (not (string-match "a\\<" "a"))) 250 (Assert (not (string-match "a\\<" "a")))
249 (Assert (not (string-match "\\>a" "a"))) 251 (Assert (not (string-match "\\>a" "a")))
250 ;; Expect these to fail :-( 252 (Known-Bug-Expect-Failure
251 (Assert (not (string-match "\\b" ""))) 253 (Assert (not (string-match "\\b" "")))
252 (Assert (not (string-match " \\b" " "))) 254 (Assert (not (string-match "\\b" " ")))
253 (Assert (not (string-match "\\b " " "))) 255 (Assert (not (string-match " \\b" " ")))
256 (Assert (not (string-match "\\b " " "))))