diff tests/automated/regexp-tests.el @ 2324:df2fafa399a1

[xemacs-hg @ 2004-10-07 08:01:41 by stephent] test for shy groups counted in registers bug <87vfdnx8n7.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Thu, 07 Oct 2004 08:01:44 +0000
parents cf4470caf504
children 60989130c706
line wrap: on
line diff
--- a/tests/automated/regexp-tests.el	Wed Oct 06 21:51:33 2004 +0000
+++ b/tests/automated/regexp-tests.el	Thu Oct 07 08:01:44 2004 +0000
@@ -408,3 +408,18 @@
   (Assert (eq 0 (string-match "^\\(?:a\\)*b" text)))	; 0
 )
 
+;; per Steve Youngs 2004-09-30 <microsoft-free.87ekkjhj7t.fsf@youngs.au.com>
+;; fix submitted by sjt 2004-10-07
+;; trailing comments are values from buggy 21.4.pre16
+(let ((text "abc"))
+  (Assert (eq 0 (string-match "\\(?:a\\(b\\)\\)" text)))	; 0
+  (Assert (string= (match-string 1 text) "b"))			; ab
+  (Assert (null (match-string 2 text)))				; b
+  (Assert (null (match-string 3 text)))				; nil
+  (Assert (eq 0 (string-match "\\(?:a\\(?:b\\(c\\)\\)\\)" text)))	; 0
+  (Assert (string= (match-string 1 text) "c"))			; abc
+  (Assert (null (match-string 2 text)))				; ab
+  (Assert (null (match-string 3 text)))				; c
+  (Assert (null (match-string 4 text)))				; nil
+)
+