head	1.5;
access;
symbols
	RELENG_8_4:1.5.0.2
	RELENG_9_1_0_RELEASE:1.4.2.1.4.2
	RELENG_9_1:1.4.2.1.0.4
	RELENG_9_1_BP:1.4.2.1
	RELENG_8_3_0_RELEASE:1.3.10.1.8.1
	RELENG_8_3:1.3.10.1.0.8
	RELENG_8_3_BP:1.3.10.1
	RELENG_9_0_0_RELEASE:1.4.2.1.2.1
	RELENG_9_0:1.4.2.1.0.2
	RELENG_9_0_BP:1.4.2.1
	RELENG_9:1.4.0.2
	RELENG_9_BP:1.4
	RELENG_7_4_0_RELEASE:1.3.14.1
	RELENG_8_2_0_RELEASE:1.3.10.1.6.1
	RELENG_7_4:1.3.0.14
	RELENG_7_4_BP:1.3
	RELENG_8_2:1.3.10.1.0.6
	RELENG_8_2_BP:1.3.10.1
	RELENG_8_1_0_RELEASE:1.3.10.1.4.1
	RELENG_8_1:1.3.10.1.0.4
	RELENG_8_1_BP:1.3.10.1
	RELENG_7_3_0_RELEASE:1.3.12.1
	RELENG_7_3:1.3.0.12
	RELENG_7_3_BP:1.3
	RELENG_8_0_0_RELEASE:1.3.10.1.2.1
	RELENG_8_0:1.3.10.1.0.2
	RELENG_8_0_BP:1.3.10.1
	RELENG_8:1.3.0.10
	RELENG_8_BP:1.3
	RELENG_7_2_0_RELEASE:1.3.8.1
	RELENG_7_2:1.3.0.8
	RELENG_7_2_BP:1.3
	RELENG_7_1_0_RELEASE:1.3.6.1
	RELENG_6_4_0_RELEASE:1.2.14.1.4.1
	RELENG_7_1:1.3.0.6
	RELENG_7_1_BP:1.3
	RELENG_6_4:1.2.14.1.0.4
	RELENG_6_4_BP:1.2.14.1
	RELENG_7_0_0_RELEASE:1.3
	RELENG_6_3_0_RELEASE:1.2.14.1
	RELENG_7_0:1.3.0.4
	RELENG_7_0_BP:1.3
	RELENG_6_3:1.2.14.1.0.2
	RELENG_6_3_BP:1.2.14.1
	RELENG_7:1.3.0.2
	RELENG_7_BP:1.3
	RELENG_6_2_0_RELEASE:1.2
	RELENG_6_2:1.2.0.22
	RELENG_6_2_BP:1.2
	RELENG_5_5_0_RELEASE:1.2
	RELENG_5_5:1.2.0.20
	RELENG_5_5_BP:1.2
	RELENG_6_1_0_RELEASE:1.2
	RELENG_6_1:1.2.0.18
	RELENG_6_1_BP:1.2
	RELENG_6_0_0_RELEASE:1.2
	RELENG_6_0:1.2.0.16
	RELENG_6_0_BP:1.2
	RELENG_6:1.2.0.14
	RELENG_6_BP:1.2
	RELENG_5_4_0_RELEASE:1.2
	RELENG_5_4:1.2.0.12
	RELENG_5_4_BP:1.2
	RELENG_5_3_0_RELEASE:1.2
	RELENG_5_3:1.2.0.10
	RELENG_5_3_BP:1.2
	RELENG_5:1.2.0.8
	RELENG_5_BP:1.2
	RELENG_5_2_1_RELEASE:1.2
	RELENG_5_2_0_RELEASE:1.2
	RELENG_5_2:1.2.0.6
	RELENG_5_2_BP:1.2
	RELENG_5_1_0_RELEASE:1.2
	RELENG_5_1:1.2.0.4
	RELENG_5_1_BP:1.2
	RELENG_5_0_0_RELEASE:1.2
	RELENG_5_0:1.2.0.2
	RELENG_5_0_BP:1.2
	PRE_SMPNG:1.2;
locks; strict;
comment	@# @;


1.5
date	2012.11.17.01.49.36;	author svnexp;	state Exp;
branches
	1.5.2.1;
next	1.4;

1.4
date	2009.09.15.21.15.29;	author dds;	state Exp;
branches
	1.4.2.1;
next	1.3;

1.3
date	2007.03.05.09.44.41;	author delphij;	state Exp;
branches
	1.3.2.1
	1.3.6.1
	1.3.8.1
	1.3.10.1
	1.3.12.1
	1.3.14.1;
next	1.2;

1.2
date	2000.07.09.18.14.39;	author dcs;	state Exp;
branches
	1.2.14.1;
next	1.1;

1.1
date	2000.07.09.18.13.35;	author dcs;	state Exp;
branches;
next	;

1.5.2.1
date	2012.11.17.01.49.36;	author svnexp;	state dead;
branches;
next	1.5.2.2;

1.5.2.2
date	2013.03.28.13.03.05;	author svnexp;	state Exp;
branches;
next	;

1.4.2.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.4.2.1.2.1
	1.4.2.1.4.1;
next	1.4.2.2;

1.4.2.2
date	2012.11.17.11.36.19;	author svnexp;	state Exp;
branches;
next	;

1.4.2.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.4.2.1.2.2;

1.4.2.1.2.2
date	2012.11.17.08.36.20;	author svnexp;	state Exp;
branches;
next	;

1.4.2.1.4.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.4.2.1.4.2;

1.4.2.1.4.2
date	2012.11.17.08.47.09;	author svnexp;	state Exp;
branches;
next	;

1.3.2.1
date	2012.11.17.08.02.14;	author svnexp;	state Exp;
branches;
next	;

1.3.6.1
date	2008.11.25.02.59.29;	author kensmith;	state Exp;
branches;
next	;

1.3.8.1
date	2009.04.15.03.14.26;	author kensmith;	state Exp;
branches;
next	;

1.3.10.1
date	2009.08.03.08.13.06;	author kensmith;	state Exp;
branches
	1.3.10.1.2.1
	1.3.10.1.4.1
	1.3.10.1.6.1
	1.3.10.1.8.1;
next	1.3.10.2;

1.3.10.2
date	2012.11.17.10.36.04;	author svnexp;	state Exp;
branches;
next	;

1.3.10.1.2.1
date	2009.10.25.01.10.29;	author kensmith;	state Exp;
branches;
next	;

1.3.10.1.4.1
date	2010.06.14.02.09.06;	author kensmith;	state Exp;
branches;
next	;

1.3.10.1.6.1
date	2010.12.21.17.09.25;	author kensmith;	state Exp;
branches;
next	;

1.3.10.1.8.1
date	2012.03.03.06.15.13;	author kensmith;	state Exp;
branches;
next	1.3.10.1.8.2;

1.3.10.1.8.2
date	2012.11.17.08.24.45;	author svnexp;	state Exp;
branches;
next	;

1.3.12.1
date	2010.02.10.00.26.20;	author kensmith;	state Exp;
branches;
next	;

1.3.14.1
date	2010.12.21.17.10.29;	author kensmith;	state Exp;
branches;
next	1.3.14.2;

1.3.14.2
date	2012.11.17.08.16.44;	author svnexp;	state Exp;
branches;
next	;

1.2.14.1
date	2007.03.15.05.51.24;	author delphij;	state Exp;
branches
	1.2.14.1.4.1;
next	1.2.14.2;

1.2.14.2
date	2012.11.17.07.40.00;	author svnexp;	state Exp;
branches;
next	;

1.2.14.1.4.1
date	2008.10.02.02.57.24;	author kensmith;	state Exp;
branches;
next	;


desc
@@


1.5
log
@Switching exporter and resync
@
text
@# regular expression test set
# $FreeBSD: head/lib/libc/regex/grot/tests 197234 2009-09-15 21:15:29Z dds $
# Lines are at least three fields, separated by one or more tabs.  "" stands
# for an empty field.  First field is an RE.  Second field is flags.  If
# C flag given, regcomp() is expected to fail, and the third field is the
# error name (minus the leading REG_).
#
# Otherwise it is expected to succeed, and the third field is the string to
# try matching it against.  If there is no fourth field, the match is
# expected to fail.  If there is a fourth field, it is the substring that
# the RE is expected to match.  If there is a fifth field, it is a comma-
# separated list of what the subexpressions should match, with - indicating
# no match for that one.  In both the fourth and fifth fields, a (sub)field
# starting with @@ indicates that the (sub)expression is expected to match
# a null string followed by the stuff after the @@; this provides a way to
# test where null strings match.  The character `N' in REs and strings
# is newline, `S' is space, `T' is tab, `Z' is NUL.
#
# The full list of flags:
#	-	placeholder, does nothing
#	b	RE is a BRE, not an ERE
#	&	try it as both an ERE and a BRE
#	C	regcomp() error expected, third field is error name
#	i	REG_ICASE
#	m	("mundane") REG_NOSPEC
#	s	REG_NOSUB (not really testable)
#	n	REG_NEWLINE
#	^	REG_NOTBOL
#	$	REG_NOTEOL
#	#	REG_STARTEND (see below)
#	p	REG_PEND
#
# For REG_STARTEND, the start/end offsets are those of the substring
# enclosed in ().

# basics
a		&	a	a
abc		&	abc	abc
abc|de		-	abc	abc
a|b|c		-	abc	a

# parentheses and perversions thereof
a(b)c		-	abc	abc
a\(b\)c		b	abc	abc
a(		C	EPAREN
a(		b	a(	a(
a\(		-	a(	a(
a\(		bC	EPAREN
a\(b		bC	EPAREN
a(b		C	EPAREN
a(b		b	a(b	a(b
# gag me with a right parenthesis -- 1003.2 goofed here (my fault, partly)
a)		-	a)	a)
)		-	)	)
# end gagging (in a just world, those *should* give EPAREN)
a)		b	a)	a)
a\)		bC	EPAREN
\)		bC	EPAREN
a()b		-	ab	ab
a\(\)b		b	ab	ab

# anchoring and REG_NEWLINE
^abc$		&	abc	abc
a^b		-	a^b
a^b		b	a^b	a^b
a$b		-	a$b
a$b		b	a$b	a$b
^		&	abc	@@abc
$		&	abc	@@
^$		&	""	@@
$^		-	""	@@
\($\)\(^\)	b	""	@@
# stop retching, those are legitimate (although disgusting)
^^		-	""	@@
$$		-	""	@@
b$		&	abNc
b$		&n	abNc	b
^b$		&	aNbNc
^b$		&n	aNbNc	b
^$		&n	aNNb	@@Nb
^$		n	abc
^$		n	abcN	@@
$^		n	aNNb	@@Nb
\($\)\(^\)	bn	aNNb	@@Nb
^^		n^	aNNb	@@Nb
$$		n	aNNb	@@NN
^a		^	a
a$		$	a
^a		^n	aNb
^b		^n	aNb	b
a$		$n	bNa
b$		$n	bNa	b
a*(^b$)c*	-	b	b
a*\(^b$\)c*	b	b	b

# certain syntax errors and non-errors
|		C	EMPTY
|		b	|	|
*		C	BADRPT
*		b	*	*
+		C	BADRPT
?		C	BADRPT
""		&C	EMPTY
()		-	abc	@@abc
\(\)		b	abc	@@abc
a||b		C	EMPTY
|ab		C	EMPTY
ab|		C	EMPTY
(|a)b		C	EMPTY
(a|)b		C	EMPTY
(*a)		C	BADRPT
(+a)		C	BADRPT
(?a)		C	BADRPT
({1}a)		C	BADRPT
\(\{1\}a\)	bC	BADRPT
(a|*b)		C	BADRPT
(a|+b)		C	BADRPT
(a|?b)		C	BADRPT
(a|{1}b)	C	BADRPT
^*		C	BADRPT
^*		b	*	*
^+		C	BADRPT
^?		C	BADRPT
^{1}		C	BADRPT
^\{1\}		bC	BADRPT

# metacharacters, backslashes
a.c		&	abc	abc
a[bc]d		&	abd	abd
a\*c		&	a*c	a*c
a\\b		&	a\b	a\b
a\\\*b		&	a\*b	a\*b
a\bc		&	abc	abc
a\		&C	EESCAPE
a\\bc		&	a\bc	a\bc
\{		bC	BADRPT
# trailing $ is a peculiar special case for the BRE code
a$		&	a	a
a$		&	a$
a\$		&	a
a\$		&	a$	a$
a\\$		&	a
a\\$		&	a$
a\\$		&	a\$
a\\$		&	a\	a\

# back references, ugh
a\(b\)\2c	bC	ESUBREG
a\(b\1\)c	bC	ESUBREG
a\(b*\)c\1d	b	abbcbbd	abbcbbd	bb
a\(b*\)c\1d	b	abbcbd
a\(b*\)c\1d	b	abbcbbbd
^\(.\)\1	b	abc
a\([bc]\)\1d	b	abcdabbd	abbd	b
a\(\([bc]\)\2\)*d	b	abbccd	abbccd
a\(\([bc]\)\2\)*d	b	abbcbd
# actually, this next one probably ought to fail, but the spec is unclear
a\(\(b\)*\2\)*d		b	abbbd	abbbd
# here is a case that no NFA implementation does right
\(ab*\)[ab]*\1	b	ababaaa	ababaaa	a
# check out normal matching in the presence of back refs
\(a\)\1bcd	b	aabcd	aabcd
\(a\)\1bc*d	b	aabcd	aabcd
\(a\)\1bc*d	b	aabd	aabd
\(a\)\1bc*d	b	aabcccd	aabcccd
\(a\)\1bc*[ce]d	b	aabcccd	aabcccd
^\(a\)\1b\(c\)*cd$	b	aabcccd	aabcccd
\(b*\)\(a*\1\)*	b	ab	a
\([^_]*\)\(_*\1\)*	b	foo_foo_bar_bar_bar_baz	foo_foo	foo,_foo
\([^_]*\)\(_*\1\)*	b	bar_bar_bar_baz	bar_bar_bar	bar,_bar
\([^_]*\)\(_*\1\)*	b	foo_bar_baz	foo	foo
\(.*\)\1	b	""	""
\(.*\)\1	b	a	""
\(.*\)\1	b	aa	aa
\(.*\)\1	b	aaa	aa
\(.*\)\1	b	aaaa	aaaa
\([^_]*\)\1	b	""	""
\([^_]*\)\1	b	a	""
\([^_]*\)\1	b	aa	aa
\([^_]*\)\1	b	aaa	aa
\([^_]*\)\1	b	aaaa	aaaa
foo\(.*\)bar\1	b	foolbarl	foolbarl	l
foo\(.*\)bar\1	b	foobar	foobar	""
\(\(.\)b\)*\1	b	aba
\(\(.\)b\)*\1	b	abba
\(\(.\)b\)*\1	b	abbba
\(\(.\)b\)*\1	b	abbbba	bbbb	bb,b
\(\(.\)b\)*\1	b	abbbbba	abbbbb	bb,b
\(\(.\)b\)*\1	b	abbbbbba	abbbbb	bb,b
\(\(.\)b\)*\1	b	abbbbbbbbbbbbbba	abbbbbbbbbbbbb	bb,b
\(\(.\)b\)*\1	b	abbbbbbbbbbbbbbba	abbbbbbbbbbbbbbb	bb,b

# ordinary repetitions
ab*c		&	abc	abc
ab+c		-	abc	abc
ab?c		-	abc	abc
a\(*\)b		b	a*b	a*b
a\(**\)b	b	ab	ab
a\(***\)b	bC	BADRPT
*a		b	*a	*a
**a		b	a	a
***a		bC	BADRPT

# the dreaded bounded repetitions
{		&	{	{
{abc		&	{abc	{abc
{1		C	BADRPT
{1}		C	BADRPT
a{b		&	a{b	a{b
a{1}b		-	ab	ab
a\{1\}b		b	ab	ab
a{1,}b		-	ab	ab
a\{1,\}b	b	ab	ab
a{1,2}b		-	aab	aab
a\{1,2\}b	b	aab	aab
a{1		C	EBRACE
a\{1		bC	EBRACE
a{1a		C	EBRACE
a\{1a		bC	EBRACE
a{1a}		C	BADBR
a\{1a\}		bC	BADBR
a{,2}		-	a{,2}	a{,2}
a\{,2\}		bC	BADBR
a{,}		-	a{,}	a{,}
a\{,\}		bC	BADBR
a{1,x}		C	BADBR
a\{1,x\}	bC	BADBR
a{1,x		C	EBRACE
a\{1,x		bC	EBRACE
a{300}		C	BADBR
a\{300\}	bC	BADBR
a{1,0}		C	BADBR
a\{1,0\}	bC	BADBR
ab{0,0}c	-	abcac	ac
ab\{0,0\}c	b	abcac	ac
ab{0,1}c	-	abcac	abc
ab\{0,1\}c	b	abcac	abc
ab{0,3}c	-	abbcac	abbc
ab\{0,3\}c	b	abbcac	abbc
ab{1,1}c	-	acabc	abc
ab\{1,1\}c	b	acabc	abc
ab{1,3}c	-	acabc	abc
ab\{1,3\}c	b	acabc	abc
ab{2,2}c	-	abcabbc	abbc
ab\{2,2\}c	b	abcabbc	abbc
ab{2,4}c	-	abcabbc	abbc
ab\{2,4\}c	b	abcabbc	abbc
((a{1,10}){1,10}){1,10}	-	a	a	a,a
((a{1,10}){1,10}){1,10}bb	-	aaaaaaaaaaaaaaaaaaaaaaaaaaaaaabb	aaaaaaaaaaaaaaaaaaaaaaaaaaaaaabb

# multiple repetitions
a**		&C	BADRPT
a++		C	BADRPT
a??		C	BADRPT
a*+		C	BADRPT
a*?		C	BADRPT
a+*		C	BADRPT
a+?		C	BADRPT
a?*		C	BADRPT
a?+		C	BADRPT
a{1}{1}		C	BADRPT
a*{1}		C	BADRPT
a+{1}		C	BADRPT
a?{1}		C	BADRPT
a{1}*		C	BADRPT
a{1}+		C	BADRPT
a{1}?		C	BADRPT
a*{b}		-	a{b}	a{b}
a\{1\}\{1\}	bC	BADRPT
a*\{1\}		bC	BADRPT
a\{1\}*		bC	BADRPT

# brackets, and numerous perversions thereof
a[b]c		&	abc	abc
a[ab]c		&	abc	abc
a[^ab]c		&	adc	adc
a[]b]c		&	a]c	a]c
a[[b]c		&	a[c	a[c
a[-b]c		&	a-c	a-c
a[^]b]c		&	adc	adc
a[^-b]c		&	adc	adc
a[b-]c		&	a-c	a-c
a[b		&C	EBRACK
a[]		&C	EBRACK
a[1-3]c		&	a2c	a2c
a[3-1]c		&C	ERANGE
a[1-3-5]c	&C	ERANGE
a[[.-.]--]c	&	a-c	a-c
a[1-		&C	ERANGE
a[[.		&C	EBRACK
a[[.x		&C	EBRACK
a[[.x.		&C	EBRACK
a[[.x.]		&C	EBRACK
a[[.x.]]	&	ax	ax
a[[.x,.]]	&C	ECOLLATE
a[[.one.]]b	&	a1b	a1b
a[[.notdef.]]b	&C	ECOLLATE
a[[.].]]b	&	a]b	a]b
a[[:alpha:]]c	&	abc	abc
a[[:notdef:]]c	&C	ECTYPE
a[[:		&C	EBRACK
a[[:alpha	&C	EBRACK
a[[:alpha:]	&C	EBRACK
a[[:alpha,:]	&C	ECTYPE
a[[:]:]]b	&C	ECTYPE
a[[:-:]]b	&C	ECTYPE
a[[:alph:]]	&C	ECTYPE
a[[:alphabet:]]	&C	ECTYPE
[[:alnum:]]+	-	-%@@a0X-	a0X
[[:alpha:]]+	-	-%@@aX0-	aX
[[:blank:]]+	-	aSSTb	SST
[[:cntrl:]]+	-	aNTb	NT
[[:digit:]]+	-	a019b	019
[[:graph:]]+	-	Sa%bS	a%b
[[:lower:]]+	-	AabC	ab
[[:print:]]+	-	NaSbN	aSb
[[:punct:]]+	-	S%-&T	%-&
[[:space:]]+	-	aSNTb	SNT
[[:upper:]]+	-	aBCd	BC
[[:xdigit:]]+	-	p0f3Cq	0f3C
a[[=b=]]c	&	abc	abc
a[[=		&C	EBRACK
a[[=b		&C	EBRACK
a[[=b=		&C	EBRACK
a[[=b=]		&C	EBRACK
a[[=b,=]]	&C	ECOLLATE
a[[=one=]]b	&	a1b	a1b

# complexities
a(((b)))c	-	abc	abc
a(b|(c))d	-	abd	abd
a(b*|c)d	-	abbd	abbd
# just gotta have one DFA-buster, of course
a[ab]{20}	-	aaaaabaaaabaaaabaaaab	aaaaabaaaabaaaabaaaab
# and an inline expansion in case somebody gets tricky
a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab]	-	aaaaabaaaabaaaabaaaab	aaaaabaaaabaaaabaaaab
# and in case somebody just slips in an NFA...
a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab](wee|week)(knights|night)	-	aaaaabaaaabaaaabaaaabweeknights	aaaaabaaaabaaaabaaaabweeknights
# fish for anomalies as the number of states passes 32
12345678901234567890123456789	-	a12345678901234567890123456789b	12345678901234567890123456789
123456789012345678901234567890	-	a123456789012345678901234567890b	123456789012345678901234567890
1234567890123456789012345678901	-	a1234567890123456789012345678901b	1234567890123456789012345678901
12345678901234567890123456789012	-	a12345678901234567890123456789012b	12345678901234567890123456789012
123456789012345678901234567890123	-	a123456789012345678901234567890123b	123456789012345678901234567890123
# and one really big one, beyond any plausible word width
1234567890123456789012345678901234567890123456789012345678901234567890	-	a1234567890123456789012345678901234567890123456789012345678901234567890b	1234567890123456789012345678901234567890123456789012345678901234567890
# fish for problems as brackets go past 8
[ab][cd][ef][gh][ij][kl][mn]	-	xacegikmoq	acegikm
[ab][cd][ef][gh][ij][kl][mn][op]	-	xacegikmoq	acegikmo
[ab][cd][ef][gh][ij][kl][mn][op][qr]	-	xacegikmoqy	acegikmoq
[ab][cd][ef][gh][ij][kl][mn][op][q]	-	xacegikmoqy	acegikmoq

# subtleties of matching
abc		&	xabcy	abc
a\(b\)?c\1d	b	acd
aBc		i	Abc	Abc
a[Bc]*d		i	abBCcd	abBCcd
0[[:upper:]]1	&i	0a1	0a1
0[[:lower:]]1	&i	0A1	0A1
a[^b]c		&i	abc
a[^b]c		&i	aBc
a[^b]c		&i	adc	adc
[a]b[c]		-	abc	abc
[a]b[a]		-	aba	aba
[abc]b[abc]	-	abc	abc
[abc]b[abd]	-	abd	abd
a(b?c)+d	-	accd	accd
(wee|week)(knights|night)	-	weeknights	weeknights
(we|wee|week|frob)(knights|night|day)	-	weeknights	weeknights
a[bc]d		-	xyzaaabcaababdacd	abd
a[ab]c		-	aaabc	abc
abc		s	abc	abc

# subexpressions
a(b)(c)d	-	abcd	abcd	b,c
a(((b)))c	-	abc	abc	b,b,b
a(b|(c))d	-	abd	abd	b,-
a(b*|c|e)d	-	abbd	abbd	bb
a(b*|c|e)d	-	acd	acd	c
a(b*|c|e)d	-	ad	ad	@@d
a(b?)c		-	abc	abc	b
a(b?)c		-	ac	ac	@@c
a(b+)c		-	abc	abc	b
a(b+)c		-	abbbc	abbbc	bbb
a(b*)c		-	ac	ac	@@c
(a|ab)(bc([de]+)f|cde)	-	abcdef	abcdef	a,bcdef,de
# the regression tester only asks for 9 subexpressions
a(b)(c)(d)(e)(f)(g)(h)(i)(j)k	-	abcdefghijk	abcdefghijk	b,c,d,e,f,g,h,i,j
a(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)l	-	abcdefghijkl	abcdefghijkl	b,c,d,e,f,g,h,i,j,k
a([bc]?)c	-	abc	abc	b
a([bc]?)c	-	ac	ac	@@c
a([bc]+)c	-	abc	abc	b
a([bc]+)c	-	abcc	abcc	bc
a([bc]+)bc	-	abcbc	abcbc	bc
a(bb+|b)b	-	abb	abb	b
a(bbb+|bb+|b)b	-	abb	abb	b
a(bbb+|bb+|b)b	-	abbb	abbb	bb
a(bbb+|bb+|b)bb	-	abbb	abbb	b
(.*).*		-	abcdef	abcdef	abcdef
(a*)*		-	bc	@@b	@@b

# do we get the right subexpression when it is used more than once?
a(b|c)*d	-	ad	ad	-
a(b|c)*d	-	abcd	abcd	c
a(b|c)+d	-	abd	abd	b
a(b|c)+d	-	abcd	abcd	c
a(b|c?)+d	-	ad	ad	@@d
a(b|c?)+d	-	abcd	abcd	@@d
a(b|c){0,0}d	-	ad	ad	-
a(b|c){0,1}d	-	ad	ad	-
a(b|c){0,1}d	-	abd	abd	b
a(b|c){0,2}d	-	ad	ad	-
a(b|c){0,2}d	-	abcd	abcd	c
a(b|c){0,}d	-	ad	ad	-
a(b|c){0,}d	-	abcd	abcd	c
a(b|c){1,1}d	-	abd	abd	b
a(b|c){1,1}d	-	acd	acd	c
a(b|c){1,2}d	-	abd	abd	b
a(b|c){1,2}d	-	abcd	abcd	c
a(b|c){1,}d	-	abd	abd	b
a(b|c){1,}d	-	abcd	abcd	c
a(b|c){2,2}d	-	acbd	acbd	b
a(b|c){2,2}d	-	abcd	abcd	c
a(b|c){2,4}d	-	abcd	abcd	c
a(b|c){2,4}d	-	abcbd	abcbd	b
a(b|c){2,4}d	-	abcbcd	abcbcd	c
a(b|c){2,}d	-	abcd	abcd	c
a(b|c){2,}d	-	abcbd	abcbd	b
a(b+|((c)*))+d	-	abd	abd	@@d,@@d,-
a(b+|((c)*))+d	-	abcd	abcd	@@d,@@d,-

# check out the STARTEND option
[abc]		&#	a(b)c	b
[abc]		&#	a(d)c
[abc]		&#	a(bc)d	b
[abc]		&#	a(dc)d	c
.		&#	a()c
b.*c		&#	b(bc)c	bc
b.*		&#	b(bc)c	bc
.*c		&#	b(bc)c	bc

# plain strings, with the NOSPEC flag
abc		m	abc	abc
abc		m	xabcy	abc
abc		m	xyz
a*b		m	aba*b	a*b
a*b		m	ab
""		mC	EMPTY

# cases involving NULs
aZb		&	a	a
aZb		&p	a
aZb		&p#	(aZb)	aZb
aZ*b		&p#	(ab)	ab
a.b		&#	(aZb)	aZb
a.*		&#	(aZb)c	aZb

# word boundaries (ick)
[[:<:]]a	&	a	a
[[:<:]]a	&	ba
[[:<:]]a	&	-a	a
a[[:>:]]	&	a	a
a[[:>:]]	&	ab
a[[:>:]]	&	a-	a
[[:<:]]a.c[[:>:]]	&	axcd-dayc-dazce-abc	abc
[[:<:]]a.c[[:>:]]	&	axcd-dayc-dazce-abc-q	abc
[[:<:]]a.c[[:>:]]	&	axc-dayc-dazce-abc	axc

# past problems
(A[1])|(A[2])|(A[3])|(A[4])|(A[5])|(A[6])|(A[7])|(A[8])|(A[9])|(A[A])	-	A1	A1
abcdefghijklmnop	i	abcdefghijklmnop	abcdefghijklmnop
abcdefghijklmnopqrstuv	i	abcdefghijklmnopqrstuv	abcdefghijklmnopqrstuv
(ALAK)|(ALT[AB])|(CC[123]1)|(CM[123]1)|(GAMC)|(LC[23][EO ])|(SEM[1234])|(SL[ES][12])|(SLWW)|(SLF )|(SLDT)|(VWH[12])|(WH[34][EW])|(WP1[ESN])	-	CC11	CC11
CC[13]1|a{21}[23][EO][123][Es][12]a{15}aa[34][EW]aaaaaaa[X]a	-	CC11	CC11
# PR 130504
(.|())(b)	-	ab	ab
(()|.)(b)	-	ab	ab
@


1.5.2.1
log
@file tests was added on branch RELENG_8_4 on 2013-03-28 13:03:05 +0000
@
text
@d1 477
@


1.5.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 474
# regular expression test set
# $FreeBSD: releng/8.4/lib/libc/regex/grot/tests 167223 2007-03-05 09:44:41Z delphij $
# Lines are at least three fields, separated by one or more tabs.  "" stands
# for an empty field.  First field is an RE.  Second field is flags.  If
# C flag given, regcomp() is expected to fail, and the third field is the
# error name (minus the leading REG_).
#
# Otherwise it is expected to succeed, and the third field is the string to
# try matching it against.  If there is no fourth field, the match is
# expected to fail.  If there is a fourth field, it is the substring that
# the RE is expected to match.  If there is a fifth field, it is a comma-
# separated list of what the subexpressions should match, with - indicating
# no match for that one.  In both the fourth and fifth fields, a (sub)field
# starting with @@ indicates that the (sub)expression is expected to match
# a null string followed by the stuff after the @@; this provides a way to
# test where null strings match.  The character `N' in REs and strings
# is newline, `S' is space, `T' is tab, `Z' is NUL.
#
# The full list of flags:
#	-	placeholder, does nothing
#	b	RE is a BRE, not an ERE
#	&	try it as both an ERE and a BRE
#	C	regcomp() error expected, third field is error name
#	i	REG_ICASE
#	m	("mundane") REG_NOSPEC
#	s	REG_NOSUB (not really testable)
#	n	REG_NEWLINE
#	^	REG_NOTBOL
#	$	REG_NOTEOL
#	#	REG_STARTEND (see below)
#	p	REG_PEND
#
# For REG_STARTEND, the start/end offsets are those of the substring
# enclosed in ().

# basics
a		&	a	a
abc		&	abc	abc
abc|de		-	abc	abc
a|b|c		-	abc	a

# parentheses and perversions thereof
a(b)c		-	abc	abc
a\(b\)c		b	abc	abc
a(		C	EPAREN
a(		b	a(	a(
a\(		-	a(	a(
a\(		bC	EPAREN
a\(b		bC	EPAREN
a(b		C	EPAREN
a(b		b	a(b	a(b
# gag me with a right parenthesis -- 1003.2 goofed here (my fault, partly)
a)		-	a)	a)
)		-	)	)
# end gagging (in a just world, those *should* give EPAREN)
a)		b	a)	a)
a\)		bC	EPAREN
\)		bC	EPAREN
a()b		-	ab	ab
a\(\)b		b	ab	ab

# anchoring and REG_NEWLINE
^abc$		&	abc	abc
a^b		-	a^b
a^b		b	a^b	a^b
a$b		-	a$b
a$b		b	a$b	a$b
^		&	abc	@@abc
$		&	abc	@@
^$		&	""	@@
$^		-	""	@@
\($\)\(^\)	b	""	@@
# stop retching, those are legitimate (although disgusting)
^^		-	""	@@
$$		-	""	@@
b$		&	abNc
b$		&n	abNc	b
^b$		&	aNbNc
^b$		&n	aNbNc	b
^$		&n	aNNb	@@Nb
^$		n	abc
^$		n	abcN	@@
$^		n	aNNb	@@Nb
\($\)\(^\)	bn	aNNb	@@Nb
^^		n^	aNNb	@@Nb
$$		n	aNNb	@@NN
^a		^	a
a$		$	a
^a		^n	aNb
^b		^n	aNb	b
a$		$n	bNa
b$		$n	bNa	b
a*(^b$)c*	-	b	b
a*\(^b$\)c*	b	b	b

# certain syntax errors and non-errors
|		C	EMPTY
|		b	|	|
*		C	BADRPT
*		b	*	*
+		C	BADRPT
?		C	BADRPT
""		&C	EMPTY
()		-	abc	@@abc
\(\)		b	abc	@@abc
a||b		C	EMPTY
|ab		C	EMPTY
ab|		C	EMPTY
(|a)b		C	EMPTY
(a|)b		C	EMPTY
(*a)		C	BADRPT
(+a)		C	BADRPT
(?a)		C	BADRPT
({1}a)		C	BADRPT
\(\{1\}a\)	bC	BADRPT
(a|*b)		C	BADRPT
(a|+b)		C	BADRPT
(a|?b)		C	BADRPT
(a|{1}b)	C	BADRPT
^*		C	BADRPT
^*		b	*	*
^+		C	BADRPT
^?		C	BADRPT
^{1}		C	BADRPT
^\{1\}		bC	BADRPT

# metacharacters, backslashes
a.c		&	abc	abc
a[bc]d		&	abd	abd
a\*c		&	a*c	a*c
a\\b		&	a\b	a\b
a\\\*b		&	a\*b	a\*b
a\bc		&	abc	abc
a\		&C	EESCAPE
a\\bc		&	a\bc	a\bc
\{		bC	BADRPT
# trailing $ is a peculiar special case for the BRE code
a$		&	a	a
a$		&	a$
a\$		&	a
a\$		&	a$	a$
a\\$		&	a
a\\$		&	a$
a\\$		&	a\$
a\\$		&	a\	a\

# back references, ugh
a\(b\)\2c	bC	ESUBREG
a\(b\1\)c	bC	ESUBREG
a\(b*\)c\1d	b	abbcbbd	abbcbbd	bb
a\(b*\)c\1d	b	abbcbd
a\(b*\)c\1d	b	abbcbbbd
^\(.\)\1	b	abc
a\([bc]\)\1d	b	abcdabbd	abbd	b
a\(\([bc]\)\2\)*d	b	abbccd	abbccd
a\(\([bc]\)\2\)*d	b	abbcbd
# actually, this next one probably ought to fail, but the spec is unclear
a\(\(b\)*\2\)*d		b	abbbd	abbbd
# here is a case that no NFA implementation does right
\(ab*\)[ab]*\1	b	ababaaa	ababaaa	a
# check out normal matching in the presence of back refs
\(a\)\1bcd	b	aabcd	aabcd
\(a\)\1bc*d	b	aabcd	aabcd
\(a\)\1bc*d	b	aabd	aabd
\(a\)\1bc*d	b	aabcccd	aabcccd
\(a\)\1bc*[ce]d	b	aabcccd	aabcccd
^\(a\)\1b\(c\)*cd$	b	aabcccd	aabcccd
\(b*\)\(a*\1\)*	b	ab	a
\([^_]*\)\(_*\1\)*	b	foo_foo_bar_bar_bar_baz	foo_foo	foo,_foo
\([^_]*\)\(_*\1\)*	b	bar_bar_bar_baz	bar_bar_bar	bar,_bar
\([^_]*\)\(_*\1\)*	b	foo_bar_baz	foo	foo
\(.*\)\1	b	""	""
\(.*\)\1	b	a	""
\(.*\)\1	b	aa	aa
\(.*\)\1	b	aaa	aa
\(.*\)\1	b	aaaa	aaaa
\([^_]*\)\1	b	""	""
\([^_]*\)\1	b	a	""
\([^_]*\)\1	b	aa	aa
\([^_]*\)\1	b	aaa	aa
\([^_]*\)\1	b	aaaa	aaaa
foo\(.*\)bar\1	b	foolbarl	foolbarl	l
foo\(.*\)bar\1	b	foobar	foobar	""
\(\(.\)b\)*\1	b	aba
\(\(.\)b\)*\1	b	abba
\(\(.\)b\)*\1	b	abbba
\(\(.\)b\)*\1	b	abbbba	bbbb	bb,b
\(\(.\)b\)*\1	b	abbbbba	abbbbb	bb,b
\(\(.\)b\)*\1	b	abbbbbba	abbbbb	bb,b
\(\(.\)b\)*\1	b	abbbbbbbbbbbbbba	abbbbbbbbbbbbb	bb,b
\(\(.\)b\)*\1	b	abbbbbbbbbbbbbbba	abbbbbbbbbbbbbbb	bb,b

# ordinary repetitions
ab*c		&	abc	abc
ab+c		-	abc	abc
ab?c		-	abc	abc
a\(*\)b		b	a*b	a*b
a\(**\)b	b	ab	ab
a\(***\)b	bC	BADRPT
*a		b	*a	*a
**a		b	a	a
***a		bC	BADRPT

# the dreaded bounded repetitions
{		&	{	{
{abc		&	{abc	{abc
{1		C	BADRPT
{1}		C	BADRPT
a{b		&	a{b	a{b
a{1}b		-	ab	ab
a\{1\}b		b	ab	ab
a{1,}b		-	ab	ab
a\{1,\}b	b	ab	ab
a{1,2}b		-	aab	aab
a\{1,2\}b	b	aab	aab
a{1		C	EBRACE
a\{1		bC	EBRACE
a{1a		C	EBRACE
a\{1a		bC	EBRACE
a{1a}		C	BADBR
a\{1a\}		bC	BADBR
a{,2}		-	a{,2}	a{,2}
a\{,2\}		bC	BADBR
a{,}		-	a{,}	a{,}
a\{,\}		bC	BADBR
a{1,x}		C	BADBR
a\{1,x\}	bC	BADBR
a{1,x		C	EBRACE
a\{1,x		bC	EBRACE
a{300}		C	BADBR
a\{300\}	bC	BADBR
a{1,0}		C	BADBR
a\{1,0\}	bC	BADBR
ab{0,0}c	-	abcac	ac
ab\{0,0\}c	b	abcac	ac
ab{0,1}c	-	abcac	abc
ab\{0,1\}c	b	abcac	abc
ab{0,3}c	-	abbcac	abbc
ab\{0,3\}c	b	abbcac	abbc
ab{1,1}c	-	acabc	abc
ab\{1,1\}c	b	acabc	abc
ab{1,3}c	-	acabc	abc
ab\{1,3\}c	b	acabc	abc
ab{2,2}c	-	abcabbc	abbc
ab\{2,2\}c	b	abcabbc	abbc
ab{2,4}c	-	abcabbc	abbc
ab\{2,4\}c	b	abcabbc	abbc
((a{1,10}){1,10}){1,10}	-	a	a	a,a
((a{1,10}){1,10}){1,10}bb	-	aaaaaaaaaaaaaaaaaaaaaaaaaaaaaabb	aaaaaaaaaaaaaaaaaaaaaaaaaaaaaabb

# multiple repetitions
a**		&C	BADRPT
a++		C	BADRPT
a??		C	BADRPT
a*+		C	BADRPT
a*?		C	BADRPT
a+*		C	BADRPT
a+?		C	BADRPT
a?*		C	BADRPT
a?+		C	BADRPT
a{1}{1}		C	BADRPT
a*{1}		C	BADRPT
a+{1}		C	BADRPT
a?{1}		C	BADRPT
a{1}*		C	BADRPT
a{1}+		C	BADRPT
a{1}?		C	BADRPT
a*{b}		-	a{b}	a{b}
a\{1\}\{1\}	bC	BADRPT
a*\{1\}		bC	BADRPT
a\{1\}*		bC	BADRPT

# brackets, and numerous perversions thereof
a[b]c		&	abc	abc
a[ab]c		&	abc	abc
a[^ab]c		&	adc	adc
a[]b]c		&	a]c	a]c
a[[b]c		&	a[c	a[c
a[-b]c		&	a-c	a-c
a[^]b]c		&	adc	adc
a[^-b]c		&	adc	adc
a[b-]c		&	a-c	a-c
a[b		&C	EBRACK
a[]		&C	EBRACK
a[1-3]c		&	a2c	a2c
a[3-1]c		&C	ERANGE
a[1-3-5]c	&C	ERANGE
a[[.-.]--]c	&	a-c	a-c
a[1-		&C	ERANGE
a[[.		&C	EBRACK
a[[.x		&C	EBRACK
a[[.x.		&C	EBRACK
a[[.x.]		&C	EBRACK
a[[.x.]]	&	ax	ax
a[[.x,.]]	&C	ECOLLATE
a[[.one.]]b	&	a1b	a1b
a[[.notdef.]]b	&C	ECOLLATE
a[[.].]]b	&	a]b	a]b
a[[:alpha:]]c	&	abc	abc
a[[:notdef:]]c	&C	ECTYPE
a[[:		&C	EBRACK
a[[:alpha	&C	EBRACK
a[[:alpha:]	&C	EBRACK
a[[:alpha,:]	&C	ECTYPE
a[[:]:]]b	&C	ECTYPE
a[[:-:]]b	&C	ECTYPE
a[[:alph:]]	&C	ECTYPE
a[[:alphabet:]]	&C	ECTYPE
[[:alnum:]]+	-	-%@@a0X-	a0X
[[:alpha:]]+	-	-%@@aX0-	aX
[[:blank:]]+	-	aSSTb	SST
[[:cntrl:]]+	-	aNTb	NT
[[:digit:]]+	-	a019b	019
[[:graph:]]+	-	Sa%bS	a%b
[[:lower:]]+	-	AabC	ab
[[:print:]]+	-	NaSbN	aSb
[[:punct:]]+	-	S%-&T	%-&
[[:space:]]+	-	aSNTb	SNT
[[:upper:]]+	-	aBCd	BC
[[:xdigit:]]+	-	p0f3Cq	0f3C
a[[=b=]]c	&	abc	abc
a[[=		&C	EBRACK
a[[=b		&C	EBRACK
a[[=b=		&C	EBRACK
a[[=b=]		&C	EBRACK
a[[=b,=]]	&C	ECOLLATE
a[[=one=]]b	&	a1b	a1b

# complexities
a(((b)))c	-	abc	abc
a(b|(c))d	-	abd	abd
a(b*|c)d	-	abbd	abbd
# just gotta have one DFA-buster, of course
a[ab]{20}	-	aaaaabaaaabaaaabaaaab	aaaaabaaaabaaaabaaaab
# and an inline expansion in case somebody gets tricky
a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab]	-	aaaaabaaaabaaaabaaaab	aaaaabaaaabaaaabaaaab
# and in case somebody just slips in an NFA...
a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab](wee|week)(knights|night)	-	aaaaabaaaabaaaabaaaabweeknights	aaaaabaaaabaaaabaaaabweeknights
# fish for anomalies as the number of states passes 32
12345678901234567890123456789	-	a12345678901234567890123456789b	12345678901234567890123456789
123456789012345678901234567890	-	a123456789012345678901234567890b	123456789012345678901234567890
1234567890123456789012345678901	-	a1234567890123456789012345678901b	1234567890123456789012345678901
12345678901234567890123456789012	-	a12345678901234567890123456789012b	12345678901234567890123456789012
123456789012345678901234567890123	-	a123456789012345678901234567890123b	123456789012345678901234567890123
# and one really big one, beyond any plausible word width
1234567890123456789012345678901234567890123456789012345678901234567890	-	a1234567890123456789012345678901234567890123456789012345678901234567890b	1234567890123456789012345678901234567890123456789012345678901234567890
# fish for problems as brackets go past 8
[ab][cd][ef][gh][ij][kl][mn]	-	xacegikmoq	acegikm
[ab][cd][ef][gh][ij][kl][mn][op]	-	xacegikmoq	acegikmo
[ab][cd][ef][gh][ij][kl][mn][op][qr]	-	xacegikmoqy	acegikmoq
[ab][cd][ef][gh][ij][kl][mn][op][q]	-	xacegikmoqy	acegikmoq

# subtleties of matching
abc		&	xabcy	abc
a\(b\)?c\1d	b	acd
aBc		i	Abc	Abc
a[Bc]*d		i	abBCcd	abBCcd
0[[:upper:]]1	&i	0a1	0a1
0[[:lower:]]1	&i	0A1	0A1
a[^b]c		&i	abc
a[^b]c		&i	aBc
a[^b]c		&i	adc	adc
[a]b[c]		-	abc	abc
[a]b[a]		-	aba	aba
[abc]b[abc]	-	abc	abc
[abc]b[abd]	-	abd	abd
a(b?c)+d	-	accd	accd
(wee|week)(knights|night)	-	weeknights	weeknights
(we|wee|week|frob)(knights|night|day)	-	weeknights	weeknights
a[bc]d		-	xyzaaabcaababdacd	abd
a[ab]c		-	aaabc	abc
abc		s	abc	abc

# subexpressions
a(b)(c)d	-	abcd	abcd	b,c
a(((b)))c	-	abc	abc	b,b,b
a(b|(c))d	-	abd	abd	b,-
a(b*|c|e)d	-	abbd	abbd	bb
a(b*|c|e)d	-	acd	acd	c
a(b*|c|e)d	-	ad	ad	@@d
a(b?)c		-	abc	abc	b
a(b?)c		-	ac	ac	@@c
a(b+)c		-	abc	abc	b
a(b+)c		-	abbbc	abbbc	bbb
a(b*)c		-	ac	ac	@@c
(a|ab)(bc([de]+)f|cde)	-	abcdef	abcdef	a,bcdef,de
# the regression tester only asks for 9 subexpressions
a(b)(c)(d)(e)(f)(g)(h)(i)(j)k	-	abcdefghijk	abcdefghijk	b,c,d,e,f,g,h,i,j
a(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)l	-	abcdefghijkl	abcdefghijkl	b,c,d,e,f,g,h,i,j,k
a([bc]?)c	-	abc	abc	b
a([bc]?)c	-	ac	ac	@@c
a([bc]+)c	-	abc	abc	b
a([bc]+)c	-	abcc	abcc	bc
a([bc]+)bc	-	abcbc	abcbc	bc
a(bb+|b)b	-	abb	abb	b
a(bbb+|bb+|b)b	-	abb	abb	b
a(bbb+|bb+|b)b	-	abbb	abbb	bb
a(bbb+|bb+|b)bb	-	abbb	abbb	b
(.*).*		-	abcdef	abcdef	abcdef
(a*)*		-	bc	@@b	@@b

# do we get the right subexpression when it is used more than once?
a(b|c)*d	-	ad	ad	-
a(b|c)*d	-	abcd	abcd	c
a(b|c)+d	-	abd	abd	b
a(b|c)+d	-	abcd	abcd	c
a(b|c?)+d	-	ad	ad	@@d
a(b|c?)+d	-	abcd	abcd	@@d
a(b|c){0,0}d	-	ad	ad	-
a(b|c){0,1}d	-	ad	ad	-
a(b|c){0,1}d	-	abd	abd	b
a(b|c){0,2}d	-	ad	ad	-
a(b|c){0,2}d	-	abcd	abcd	c
a(b|c){0,}d	-	ad	ad	-
a(b|c){0,}d	-	abcd	abcd	c
a(b|c){1,1}d	-	abd	abd	b
a(b|c){1,1}d	-	acd	acd	c
a(b|c){1,2}d	-	abd	abd	b
a(b|c){1,2}d	-	abcd	abcd	c
a(b|c){1,}d	-	abd	abd	b
a(b|c){1,}d	-	abcd	abcd	c
a(b|c){2,2}d	-	acbd	acbd	b
a(b|c){2,2}d	-	abcd	abcd	c
a(b|c){2,4}d	-	abcd	abcd	c
a(b|c){2,4}d	-	abcbd	abcbd	b
a(b|c){2,4}d	-	abcbcd	abcbcd	c
a(b|c){2,}d	-	abcd	abcd	c
a(b|c){2,}d	-	abcbd	abcbd	b
a(b+|((c)*))+d	-	abd	abd	@@d,@@d,-
a(b+|((c)*))+d	-	abcd	abcd	@@d,@@d,-

# check out the STARTEND option
[abc]		&#	a(b)c	b
[abc]		&#	a(d)c
[abc]		&#	a(bc)d	b
[abc]		&#	a(dc)d	c
.		&#	a()c
b.*c		&#	b(bc)c	bc
b.*		&#	b(bc)c	bc
.*c		&#	b(bc)c	bc

# plain strings, with the NOSPEC flag
abc		m	abc	abc
abc		m	xabcy	abc
abc		m	xyz
a*b		m	aba*b	a*b
a*b		m	ab
""		mC	EMPTY

# cases involving NULs
aZb		&	a	a
aZb		&p	a
aZb		&p#	(aZb)	aZb
aZ*b		&p#	(ab)	ab
a.b		&#	(aZb)	aZb
a.*		&#	(aZb)c	aZb

# word boundaries (ick)
[[:<:]]a	&	a	a
[[:<:]]a	&	ba
[[:<:]]a	&	-a	a
a[[:>:]]	&	a	a
a[[:>:]]	&	ab
a[[:>:]]	&	a-	a
[[:<:]]a.c[[:>:]]	&	axcd-dayc-dazce-abc	abc
[[:<:]]a.c[[:>:]]	&	axcd-dayc-dazce-abc-q	abc
[[:<:]]a.c[[:>:]]	&	axc-dayc-dazce-abc	axc

# past problems
(A[1])|(A[2])|(A[3])|(A[4])|(A[5])|(A[6])|(A[7])|(A[8])|(A[9])|(A[A])	-	A1	A1
abcdefghijklmnop	i	abcdefghijklmnop	abcdefghijklmnop
abcdefghijklmnopqrstuv	i	abcdefghijklmnopqrstuv	abcdefghijklmnopqrstuv
(ALAK)|(ALT[AB])|(CC[123]1)|(CM[123]1)|(GAMC)|(LC[23][EO ])|(SEM[1234])|(SL[ES][12])|(SLWW)|(SLF )|(SLDT)|(VWH[12])|(WH[34][EW])|(WP1[ESN])	-	CC11	CC11
CC[13]1|a{21}[23][EO][123][Es][12]a{15}aa[34][EW]aaaaaaa[X]a	-	CC11	CC11
@


1.4
log
@SVN rev 197234 on 2009-09-15 21:15:29Z by dds

Add two test cases from PR 130504.
An additional one coming from http://www.research.att.com/~gsf/testregex/
was not added; at some point the entire AT&T regression test harness
should be imported here.
But that would also mean commitment to fix the uncovered errors.

PR:		130504
Submitted by:	Chris Kuklewicz
@
text
@d2 1
a2 1
# $FreeBSD$
@


1.4.2.1
log
@SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.4.2.2
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242902
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242902 | dteske | 2012-11-11 23:29:45 +0000 (Sun, 11 Nov 2012) | 10 lines
## SVN ##
## SVN ## Fix a regression introduced by SVN r211417 that saw the breakage of a feature
## SVN ## documented in usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
## SVN ##
## SVN ## If /usr/sbin/sysinstall is linked to another filename, say
## SVN ## `/usr/local/bin/configPackages', then the basename will be used
## SVN ## as an implicit command name.
## SVN ##
## SVN ## Reviewed by:	adrian (co-mentor)
## SVN ## Approved by:	adrian (co-mentor)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d2 1
a2 1
# $FreeBSD: stable/9/lib/libc/regex/grot/tests 197234 2009-09-15 21:15:29Z dds $
@


1.4.2.1.4.1
log
@SVN rev 239080 on 2012-08-05 23:54:33Z by kensmith

Copy stable/9 to releng/9.1 as part of the 9.1-RELEASE release process.

Approved by:	re (implicit)
@
text
@@


1.4.2.1.4.2
log
@Switch importer
@
text
@d2 1
a2 1
# $FreeBSD: releng/9.1/lib/libc/regex/grot/tests 197234 2009-09-15 21:15:29Z dds $
@


1.4.2.1.2.1
log
@SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)
@
text
@@


1.4.2.1.2.2
log
@Switch importer
@
text
@d2 1
a2 1
# $FreeBSD: releng/9.0/lib/libc/regex/grot/tests 197234 2009-09-15 21:15:29Z dds $
@


1.3
log
@Test cases for back references.

Obtained from:	OpenBSD
@
text
@d475 3
@


1.3.2.1
log
@Switch importer
@
text
@d2 1
a2 1
# $FreeBSD: stable/7/lib/libc/regex/grot/tests 167223 2007-03-05 09:44:41Z delphij $
@


1.3.14.1
log
@SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)
@
text
@@


1.3.14.2
log
@Switch importer
@
text
@d2 1
a2 1
# $FreeBSD: releng/7.4/lib/libc/regex/grot/tests 167223 2007-03-05 09:44:41Z delphij $
@


1.3.12.1
log
@SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)
@
text
@@


1.3.10.1
log
@SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)
@
text
@@


1.3.10.2
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242909
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242909 | dim | 2012-11-12 07:47:19 +0000 (Mon, 12 Nov 2012) | 20 lines
## SVN ##
## SVN ## MFC r242625:
## SVN ##
## SVN ## Remove duplicate const specifiers in many drivers (I hope I got all of
## SVN ## them, please let me know if not).  Most of these are of the form:
## SVN ##
## SVN ## static const struct bzzt_type {
## SVN ##       [...list of members...]
## SVN ## } const bzzt_devs[] = {
## SVN ##       [...list of initializers...]
## SVN ## };
## SVN ##
## SVN ## The second const is unnecessary, as arrays cannot be modified anyway,
## SVN ## and if the elements are const, the whole thing is const automatically
## SVN ## (e.g. it is placed in .rodata).
## SVN ##
## SVN ## I have verified this does not change the binary output of a full kernel
## SVN ## build (except for build timestamps embedded in the object files).
## SVN ##
## SVN ## Reviewed by:	yongari, marius
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d2 1
a2 1
# $FreeBSD: stable/8/lib/libc/regex/grot/tests 167223 2007-03-05 09:44:41Z delphij $
@


1.3.10.1.8.1
log
@SVN rev 232438 on 2012-03-03 06:15:13Z by kensmith

Copy stable/8 to releng/8.3 as part of 8.3-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.3.10.1.8.2
log
@Switch importer
@
text
@d2 1
a2 1
# $FreeBSD: releng/8.3/lib/libc/regex/grot/tests 167223 2007-03-05 09:44:41Z delphij $
@


1.3.10.1.6.1
log
@SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)
@
text
@@


1.3.10.1.4.1
log
@SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)
@
text
@@


1.3.10.1.2.1
log
@SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)
@
text
@@


1.3.8.1
log
@SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)
@
text
@@


1.3.6.1
log
@SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)
@
text
@@


1.2
log
@Add a test case for one of the bugs found on the new additions to
regex(3).
@
text
@d168 24
@


1.2.14.1
log
@MFC fixes to regexp(3) from OpenBSD, this includes:
	engine.c: 1.19+1.20
	grot/tests: 1.3
@
text
@a167 24
\(b*\)\(a*\1\)*	b	ab	a
\([^_]*\)\(_*\1\)*	b	foo_foo_bar_bar_bar_baz	foo_foo	foo,_foo
\([^_]*\)\(_*\1\)*	b	bar_bar_bar_baz	bar_bar_bar	bar,_bar
\([^_]*\)\(_*\1\)*	b	foo_bar_baz	foo	foo
\(.*\)\1	b	""	""
\(.*\)\1	b	a	""
\(.*\)\1	b	aa	aa
\(.*\)\1	b	aaa	aa
\(.*\)\1	b	aaaa	aaaa
\([^_]*\)\1	b	""	""
\([^_]*\)\1	b	a	""
\([^_]*\)\1	b	aa	aa
\([^_]*\)\1	b	aaa	aa
\([^_]*\)\1	b	aaaa	aaaa
foo\(.*\)bar\1	b	foolbarl	foolbarl	l
foo\(.*\)bar\1	b	foobar	foobar	""
\(\(.\)b\)*\1	b	aba
\(\(.\)b\)*\1	b	abba
\(\(.\)b\)*\1	b	abbba
\(\(.\)b\)*\1	b	abbbba	bbbb	bb,b
\(\(.\)b\)*\1	b	abbbbba	abbbbb	bb,b
\(\(.\)b\)*\1	b	abbbbbba	abbbbb	bb,b
\(\(.\)b\)*\1	b	abbbbbbbbbbbbbba	abbbbbbbbbbbbb	bb,b
\(\(.\)b\)*\1	b	abbbbbbbbbbbbbbba	abbbbbbbbbbbbbbb	bb,b
@


1.2.14.2
log
@Switch importer
@
text
@d2 1
a2 1
# $FreeBSD: stable/6/lib/libc/regex/grot/tests 167590 2007-03-15 05:51:24Z delphij $
@


1.2.14.1.4.1
log
@SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)
@
text
@@


1.1
log
@Spencer's regex(3) test code.

Obtained from: BSD/OS
@
text
@d225 1
@

