X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=tests%2Fautomated%2Fregexp-tests.el;h=ea424800559f21c7d500db06e4494951557bbcba;hb=1bbdeb3a4ec887b8a6bcacb0384a978cc3b1f6f5;hp=6c1fcbac1dbfe8e603b8fa3e9dcc4234412a41ce;hpb=f8e9b35a0e8ba64b3f7102a30e88a6b1d0b2a18b;p=chise%2Fxemacs-chise.git- diff --git a/tests/automated/regexp-tests.el b/tests/automated/regexp-tests.el index 6c1fcba..ea42480 100644 --- a/tests/automated/regexp-tests.el +++ b/tests/automated/regexp-tests.el @@ -272,3 +272,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 . +(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"))))