diff tests/automated/regexp-tests.el @ 1195:dff007bd492b

[xemacs-hg @ 2003-01-09 12:49:36 by stephent] unit test cases <873co2wkua.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Thu, 09 Jan 2003 12:49:43 +0000
parents 2af1f88a2d31
children 6355bae896e3
line wrap: on
line diff
--- a/tests/automated/regexp-tests.el	Wed Jan 08 22:52:54 2003 +0000
+++ b/tests/automated/regexp-tests.el	Thu Jan 09 12:49:43 2003 +0000
@@ -279,3 +279,18 @@
       (Assert (not (string-match "@[A]" (string ?@ ch1))))
       (Assert (eq (string-match "@[^A]" (string ?@ ch1)) 0))
       (Assert (not (string-match "@?A" (string ?@ ch1))))))
+
+;; More stale match data tests.
+;; Thanks to <bjacob@ca.metsci.com>.
+(Assert (not (progn (string-match "a" "a")
+		    (string-match "b" "a")
+		    (match-string 0 "a"))))
+(Assert (not (progn (string-match "a" "a")
+		    (string-match "b" "a")
+		    (match-string 1 "a"))))
+(Assert (not (progn (string-match "\\(a\\)" "a")
+		    (string-match "\\(b\\)" "a")
+		    (match-string 0 "a"))))
+(Assert (not (progn (string-match "\\(a\\)" "a")
+		    (string-match "\\(b\\)" "a")
+		    (match-string 1 "a"))))