Add additional tests and a patch with changes used when running RE2/Go regex tests.
This commit is contained in:
parent
b8873b3f53
commit
1e81c00cd1
4 changed files with 3919 additions and 19 deletions
|
@ -3,22 +3,5 @@ project(att_regex_tester)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 14)
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
|
|
||||||
add_executable(att_regex_tester
|
add_executable(testregex
|
||||||
man/man1/testregex.html
|
testregex.c)
|
||||||
basic.dat
|
|
||||||
categorize.dat
|
|
||||||
forcedassoc.dat
|
|
||||||
leftassoc.dat
|
|
||||||
nullsubexpr.dat
|
|
||||||
re-assoc.html
|
|
||||||
re-categorize.html
|
|
||||||
re-interpretation.html
|
|
||||||
re-nullsubexpr.html
|
|
||||||
re-repetition.html
|
|
||||||
re2-exhaustive.txt.bz2
|
|
||||||
re2-search.txt
|
|
||||||
README.md
|
|
||||||
repetition.dat
|
|
||||||
rightassoc.dat
|
|
||||||
testregex.c
|
|
||||||
testregex.html)
|
|
||||||
|
|
BIN
re2/re2-exhaustive.txt.bz2
Normal file
BIN
re2/re2-exhaustive.txt.bz2
Normal file
Binary file not shown.
3672
re2/re2-search.txt
Normal file
3672
re2/re2-search.txt
Normal file
File diff suppressed because it is too large
Load diff
245
re2/re2.patch
Normal file
245
re2/re2.patch
Normal file
|
@ -0,0 +1,245 @@
|
||||||
|
diff --git a/basic.dat b/basic.dat
|
||||||
|
index 5c50f37..7859290 100644
|
||||||
|
--- a/basic.dat
|
||||||
|
+++ b/basic.dat
|
||||||
|
@@ -57,9 +57,10 @@ E :::1:::0:|:::1:1:1: :::0:::1:::1:::0: (8,17)
|
||||||
|
{E [[:upper:]] A (0,1) [[<element>]] not supported
|
||||||
|
E [[:lower:]]+ `az{ (1,3)
|
||||||
|
E [[:upper:]]+ @AZ[ (1,3)
|
||||||
|
-BE [[-]] [[-]] (2,4)
|
||||||
|
-BE [[.NIL.]] NULL ECOLLATE
|
||||||
|
-BE [[=aleph=]] NULL ECOLLATE
|
||||||
|
+# No collation in Go
|
||||||
|
+#BE [[-]] [[-]] (2,4)
|
||||||
|
+#BE [[.NIL.]] NULL ECOLLATE
|
||||||
|
+#BE [[=aleph=]] NULL ECOLLATE
|
||||||
|
}
|
||||||
|
BE$ \n \n (0,1)
|
||||||
|
BEn$ \n \n (0,1)
|
||||||
|
@@ -123,20 +124,24 @@ E ((a)) abc (0,1)(0,1)(0,1)
|
||||||
|
E (a)b(c) abc (0,3)(0,1)(2,3)
|
||||||
|
E a+b+c aabbabc (4,7)
|
||||||
|
E a* aaa (0,3)
|
||||||
|
-E (a*)* - (0,0)(0,0)
|
||||||
|
+#E (a*)* - (0,0)(0,0)
|
||||||
|
+E (a*)* - (0,0)(?,?) RE2/Go
|
||||||
|
E (a*)+ - (0,0)(0,0)
|
||||||
|
-E (a*|b)* - (0,0)(0,0)
|
||||||
|
+#E (a*|b)* - (0,0)(0,0)
|
||||||
|
+E (a*|b)* - (0,0)(?,?) RE2/Go
|
||||||
|
E (a+|b)* ab (0,2)(1,2)
|
||||||
|
E (a+|b)+ ab (0,2)(1,2)
|
||||||
|
E (a+|b)? ab (0,1)(0,1)
|
||||||
|
BE [^ab]* cde (0,3)
|
||||||
|
-E (^)* - (0,0)(0,0)
|
||||||
|
+#E (^)* - (0,0)(0,0)
|
||||||
|
+E (^)* - (0,0)(?,?) RE2/Go
|
||||||
|
BE a* NULL (0,0)
|
||||||
|
E ([abc])*d abbbcd (0,6)(4,5)
|
||||||
|
E ([abc])*bcd abcd (0,4)(0,1)
|
||||||
|
E a|b|c|d|e e (0,1)
|
||||||
|
E (a|b|c|d|e)f ef (0,2)(0,1)
|
||||||
|
-E ((a*|b))* - (0,0)(0,0)(0,0)
|
||||||
|
+#E ((a*|b))* - (0,0)(0,0)(0,0)
|
||||||
|
+E ((a*|b))* - (0,0)(?,?)(?,?) RE2/Go
|
||||||
|
BE abcd*efg abcdefg (0,7)
|
||||||
|
BE ab* xabyabbbz (1,3)
|
||||||
|
BE ab* xayabbbz (1,2)
|
||||||
|
diff --git a/nullsubexpr.dat b/nullsubexpr.dat
|
||||||
|
index c73d8f0..2e18fbb 100644
|
||||||
|
--- a/nullsubexpr.dat
|
||||||
|
+++ b/nullsubexpr.dat
|
||||||
|
@@ -1,7 +1,8 @@
|
||||||
|
NOTE null subexpression matches : 2002-06-06
|
||||||
|
|
||||||
|
E (a*)* a (0,1)(0,1)
|
||||||
|
-E SAME x (0,0)(0,0)
|
||||||
|
+#E SAME x (0,0)(0,0)
|
||||||
|
+E SAME x (0,0)(?,?) RE2/Go
|
||||||
|
E SAME aaaaaa (0,6)(0,6)
|
||||||
|
E SAME aaaaaax (0,6)(0,6)
|
||||||
|
E (a*)+ a (0,1)(0,1)
|
||||||
|
@@ -18,7 +19,8 @@ E SAME aaaaaa (0,6)(0,6)
|
||||||
|
E SAME aaaaaax (0,6)(0,6)
|
||||||
|
|
||||||
|
E ([a]*)* a (0,1)(0,1)
|
||||||
|
-E SAME x (0,0)(0,0)
|
||||||
|
+#E SAME x (0,0)(0,0)
|
||||||
|
+E SAME x (0,0)(?,?) RE2/Go
|
||||||
|
E SAME aaaaaa (0,6)(0,6)
|
||||||
|
E SAME aaaaaax (0,6)(0,6)
|
||||||
|
E ([a]*)+ a (0,1)(0,1)
|
||||||
|
@@ -26,7 +28,8 @@ E SAME x (0,0)(0,0)
|
||||||
|
E SAME aaaaaa (0,6)(0,6)
|
||||||
|
E SAME aaaaaax (0,6)(0,6)
|
||||||
|
E ([^b]*)* a (0,1)(0,1)
|
||||||
|
-E SAME b (0,0)(0,0)
|
||||||
|
+#E SAME b (0,0)(0,0)
|
||||||
|
+E SAME b (0,0)(?,?) RE2/Go
|
||||||
|
E SAME aaaaaa (0,6)(0,6)
|
||||||
|
E SAME aaaaaab (0,6)(0,6)
|
||||||
|
E ([ab]*)* a (0,1)(0,1)
|
||||||
|
@@ -38,18 +41,20 @@ E SAME bbbbbb (0,6)(0,6)
|
||||||
|
E SAME aaaabcde (0,5)(0,5)
|
||||||
|
E ([^a]*)* b (0,1)(0,1)
|
||||||
|
E SAME bbbbbb (0,6)(0,6)
|
||||||
|
-E SAME aaaaaa (0,0)(0,0)
|
||||||
|
+#E SAME aaaaaa (0,0)(0,0)
|
||||||
|
+E SAME aaaaaa (0,0)(?,?) RE2/Go
|
||||||
|
E ([^ab]*)* ccccxx (0,6)(0,6)
|
||||||
|
-E SAME ababab (0,0)(0,0)
|
||||||
|
+#E SAME ababab (0,0)(0,0)
|
||||||
|
+E SAME ababab (0,0)(?,?) RE2/Go
|
||||||
|
|
||||||
|
E ((z)+|a)* zabcde (0,2)(1,2)
|
||||||
|
|
||||||
|
-{E a+? aaaaaa (0,1) no *? +? mimimal match ops
|
||||||
|
-E (a) aaa (0,1)(0,1)
|
||||||
|
-E (a*?) aaa (0,0)(0,0)
|
||||||
|
-E (a)*? aaa (0,0)
|
||||||
|
-E (a*?)*? aaa (0,0)
|
||||||
|
-}
|
||||||
|
+#{E a+? aaaaaa (0,1) no *? +? mimimal match ops
|
||||||
|
+#E (a) aaa (0,1)(0,1)
|
||||||
|
+#E (a*?) aaa (0,0)(0,0)
|
||||||
|
+#E (a)*? aaa (0,0)
|
||||||
|
+#E (a*?)*? aaa (0,0)
|
||||||
|
+#}
|
||||||
|
|
||||||
|
B \(a*\)*\(x\) x (0,1)(0,0)(0,1)
|
||||||
|
B \(a*\)*\(x\) ax (0,2)(0,1)(1,2)
|
||||||
|
@@ -60,7 +65,8 @@ B \(a*\)*\(x\)\(\1\) axa (0,3)(0,1)(1,2)(2,3)
|
||||||
|
B \(a*\)*\(x\)\(\1\)\(x\) axax (0,4)(0,1)(1,2)(2,3)(3,4)
|
||||||
|
B \(a*\)*\(x\)\(\1\)\(x\) axxa (0,3)(1,1)(1,2)(2,2)(2,3)
|
||||||
|
|
||||||
|
-E (a*)*(x) x (0,1)(0,0)(0,1)
|
||||||
|
+#E (a*)*(x) x (0,1)(0,0)(0,1)
|
||||||
|
+E (a*)*(x) x (0,1)(?,?)(0,1) RE2/Go
|
||||||
|
E (a*)*(x) ax (0,2)(0,1)(1,2)
|
||||||
|
E (a*)*(x) axa (0,2)(0,1)(1,2)
|
||||||
|
|
||||||
|
diff --git a/repetition.dat b/repetition.dat
|
||||||
|
index 8e855ac..e6361f5 100644
|
||||||
|
--- a/repetition.dat
|
||||||
|
+++ b/repetition.dat
|
||||||
|
@@ -1,12 +1,11 @@
|
||||||
|
-NOTE implicit vs. explicit repetitions : 2002-08-01
|
||||||
|
-#
|
||||||
|
+NOTE implicit vs. explicit repetitions : 2009-02-02
|
||||||
|
+
|
||||||
|
# Glenn Fowler <gsf@research.att.com>
|
||||||
|
# conforming matches (column 4) must match one of the following BREs
|
||||||
|
# NOMATCH
|
||||||
|
# (0,.)\((\(.\),\(.\))(?,?)(\2,\3)\)*
|
||||||
|
# (0,.)\((\(.\),\(.\))(\2,\3)(?,?)\)*
|
||||||
|
# i.e., each 3-tuple has two identical elements and one (?,?)
|
||||||
|
-#
|
||||||
|
|
||||||
|
E ((..)|(.)) NULL NOMATCH
|
||||||
|
E ((..)|(.))((..)|(.)) NULL NOMATCH
|
||||||
|
@@ -43,10 +42,12 @@ E ((..)|(.))((..)|(.)) aaa (0,3)(0,2)(0,2)(?,?)(2,3)(?,?)(2,3)
|
||||||
|
E ((..)|(.))((..)|(.))((..)|(.)) aaa (0,3)(0,1)(?,?)(0,1)(1,2)(?,?)(1,2)(2,3)(?,?)(2,3)
|
||||||
|
|
||||||
|
E ((..)|(.)){1} aaa (0,2)(0,2)(0,2)(?,?)
|
||||||
|
-E ((..)|(.)){2} aaa (0,3)(2,3)(?,?)(2,3)
|
||||||
|
+#E ((..)|(.)){2} aaa (0,3)(2,3)(?,?)(2,3)
|
||||||
|
+E ((..)|(.)){2} aaa (0,3)(2,3)(0,2)(2,3) RE2/Go
|
||||||
|
E ((..)|(.)){3} aaa (0,3)(2,3)(?,?)(2,3)
|
||||||
|
|
||||||
|
-E ((..)|(.))* aaa (0,3)(2,3)(?,?)(2,3)
|
||||||
|
+#E ((..)|(.))* aaa (0,3)(2,3)(?,?)(2,3)
|
||||||
|
+E ((..)|(.))* aaa (0,3)(2,3)(0,2)(2,3) RE2/Go
|
||||||
|
|
||||||
|
E ((..)|(.)) aaaa (0,2)(0,2)(0,2)(?,?)
|
||||||
|
E ((..)|(.))((..)|(.)) aaaa (0,4)(0,2)(0,2)(?,?)(2,4)(2,4)(?,?)
|
||||||
|
@@ -54,7 +55,8 @@ E ((..)|(.))((..)|(.))((..)|(.)) aaaa (0,4)(0,2)(0,2)(?,?)(2,3)(?,?)(2,3)(3,4)
|
||||||
|
|
||||||
|
E ((..)|(.)){1} aaaa (0,2)(0,2)(0,2)(?,?)
|
||||||
|
E ((..)|(.)){2} aaaa (0,4)(2,4)(2,4)(?,?)
|
||||||
|
-E ((..)|(.)){3} aaaa (0,4)(3,4)(?,?)(3,4)
|
||||||
|
+#E ((..)|(.)){3} aaaa (0,4)(3,4)(?,?)(3,4)
|
||||||
|
+E ((..)|(.)){3} aaaa (0,4)(3,4)(0,2)(3,4) RE2/Go
|
||||||
|
|
||||||
|
E ((..)|(.))* aaaa (0,4)(2,4)(2,4)(?,?)
|
||||||
|
|
||||||
|
@@ -64,9 +66,11 @@ E ((..)|(.))((..)|(.))((..)|(.)) aaaaa (0,5)(0,2)(0,2)(?,?)(2,4)(2,4)(?,?)(4,5
|
||||||
|
|
||||||
|
E ((..)|(.)){1} aaaaa (0,2)(0,2)(0,2)(?,?)
|
||||||
|
E ((..)|(.)){2} aaaaa (0,4)(2,4)(2,4)(?,?)
|
||||||
|
-E ((..)|(.)){3} aaaaa (0,5)(4,5)(?,?)(4,5)
|
||||||
|
+#E ((..)|(.)){3} aaaaa (0,5)(4,5)(?,?)(4,5)
|
||||||
|
+E ((..)|(.)){3} aaaaa (0,5)(4,5)(2,4)(4,5) RE2/Go
|
||||||
|
|
||||||
|
-E ((..)|(.))* aaaaa (0,5)(4,5)(?,?)(4,5)
|
||||||
|
+#E ((..)|(.))* aaaaa (0,5)(4,5)(?,?)(4,5)
|
||||||
|
+E ((..)|(.))* aaaaa (0,5)(4,5)(2,4)(4,5) RE2/Go
|
||||||
|
|
||||||
|
E ((..)|(.)) aaaaaa (0,2)(0,2)(0,2)(?,?)
|
||||||
|
E ((..)|(.))((..)|(.)) aaaaaa (0,4)(0,2)(0,2)(?,?)(2,4)(2,4)(?,?)
|
||||||
|
@@ -92,14 +96,22 @@ NOTE additional repetition tests graciously provided by Chris Kuklewicz www.hask
|
||||||
|
:HA#106:E X(.?){6,}Y X1234567Y (0,9)(7,8)
|
||||||
|
:HA#107:E X(.?){7,}Y X1234567Y (0,9)(7,8)
|
||||||
|
:HA#108:E X(.?){8,}Y X1234567Y (0,9)(8,8)
|
||||||
|
-:HA#110:E X(.?){0,8}Y X1234567Y (0,9)(7,8)
|
||||||
|
-:HA#111:E X(.?){1,8}Y X1234567Y (0,9)(7,8)
|
||||||
|
-:HA#112:E X(.?){2,8}Y X1234567Y (0,9)(7,8)
|
||||||
|
-:HA#113:E X(.?){3,8}Y X1234567Y (0,9)(7,8)
|
||||||
|
-:HA#114:E X(.?){4,8}Y X1234567Y (0,9)(7,8)
|
||||||
|
-:HA#115:E X(.?){5,8}Y X1234567Y (0,9)(7,8)
|
||||||
|
-:HA#116:E X(.?){6,8}Y X1234567Y (0,9)(7,8)
|
||||||
|
-:HA#117:E X(.?){7,8}Y X1234567Y (0,9)(7,8)
|
||||||
|
+#:HA#110:E X(.?){0,8}Y X1234567Y (0,9)(7,8)
|
||||||
|
+:HA#110:E X(.?){0,8}Y X1234567Y (0,9)(8,8) RE2/Go
|
||||||
|
+#:HA#111:E X(.?){1,8}Y X1234567Y (0,9)(7,8)
|
||||||
|
+:HA#111:E X(.?){1,8}Y X1234567Y (0,9)(8,8) RE2/Go
|
||||||
|
+#:HA#112:E X(.?){2,8}Y X1234567Y (0,9)(7,8)
|
||||||
|
+:HA#112:E X(.?){2,8}Y X1234567Y (0,9)(8,8) RE2/Go
|
||||||
|
+#:HA#113:E X(.?){3,8}Y X1234567Y (0,9)(7,8)
|
||||||
|
+:HA#113:E X(.?){3,8}Y X1234567Y (0,9)(8,8) RE2/Go
|
||||||
|
+#:HA#114:E X(.?){4,8}Y X1234567Y (0,9)(7,8)
|
||||||
|
+:HA#114:E X(.?){4,8}Y X1234567Y (0,9)(8,8) RE2/Go
|
||||||
|
+#:HA#115:E X(.?){5,8}Y X1234567Y (0,9)(7,8)
|
||||||
|
+:HA#115:E X(.?){5,8}Y X1234567Y (0,9)(8,8) RE2/Go
|
||||||
|
+#:HA#116:E X(.?){6,8}Y X1234567Y (0,9)(7,8)
|
||||||
|
+:HA#116:E X(.?){6,8}Y X1234567Y (0,9)(8,8) RE2/Go
|
||||||
|
+#:HA#117:E X(.?){7,8}Y X1234567Y (0,9)(7,8)
|
||||||
|
+:HA#117:E X(.?){7,8}Y X1234567Y (0,9)(8,8) RE2/Go
|
||||||
|
:HA#118:E X(.?){8,8}Y X1234567Y (0,9)(8,8)
|
||||||
|
|
||||||
|
# These test a fixed bug in my regex-tdfa that did not keep the expanded
|
||||||
|
@@ -127,15 +139,25 @@ NOTE additional repetition tests graciously provided by Chris Kuklewicz www.hask
|
||||||
|
# The above worked on Linux/GLIBC but the following often fail.
|
||||||
|
# They also trip up OS X / FreeBSD / NetBSD:
|
||||||
|
|
||||||
|
-:HA#280:E (ab|a|c|bcd){0,}(d*) ababcd (0,6)(3,6)(6,6)
|
||||||
|
-:HA#281:E (ab|a|c|bcd){1,}(d*) ababcd (0,6)(3,6)(6,6)
|
||||||
|
-:HA#282:E (ab|a|c|bcd){2,}(d*) ababcd (0,6)(3,6)(6,6)
|
||||||
|
-:HA#283:E (ab|a|c|bcd){3,}(d*) ababcd (0,6)(3,6)(6,6)
|
||||||
|
+#:HA#280:E (ab|a|c|bcd){0,}(d*) ababcd (0,6)(3,6)(6,6)
|
||||||
|
+:HA#280:E (ab|a|c|bcd){0,}(d*) ababcd (0,6)(4,5)(5,6) RE2/Go
|
||||||
|
+#:HA#281:E (ab|a|c|bcd){1,}(d*) ababcd (0,6)(3,6)(6,6)
|
||||||
|
+:HA#281:E (ab|a|c|bcd){1,}(d*) ababcd (0,6)(4,5)(5,6) RE2/Go
|
||||||
|
+#:HA#282:E (ab|a|c|bcd){2,}(d*) ababcd (0,6)(3,6)(6,6)
|
||||||
|
+:HA#282:E (ab|a|c|bcd){2,}(d*) ababcd (0,6)(4,5)(5,6) RE2/Go
|
||||||
|
+#:HA#283:E (ab|a|c|bcd){3,}(d*) ababcd (0,6)(3,6)(6,6)
|
||||||
|
+:HA#283:E (ab|a|c|bcd){3,}(d*) ababcd (0,6)(4,5)(5,6) RE2/Go
|
||||||
|
:HA#284:E (ab|a|c|bcd){4,}(d*) ababcd NOMATCH
|
||||||
|
-:HA#285:E (ab|a|c|bcd){0,10}(d*) ababcd (0,6)(3,6)(6,6)
|
||||||
|
-:HA#286:E (ab|a|c|bcd){1,10}(d*) ababcd (0,6)(3,6)(6,6)
|
||||||
|
-:HA#287:E (ab|a|c|bcd){2,10}(d*) ababcd (0,6)(3,6)(6,6)
|
||||||
|
-:HA#288:E (ab|a|c|bcd){3,10}(d*) ababcd (0,6)(3,6)(6,6)
|
||||||
|
+#:HA#285:E (ab|a|c|bcd){0,10}(d*) ababcd (0,6)(3,6)(6,6)
|
||||||
|
+:HA#285:E (ab|a|c|bcd){0,10}(d*) ababcd (0,6)(4,5)(5,6) RE2/Go
|
||||||
|
+#:HA#286:E (ab|a|c|bcd){1,10}(d*) ababcd (0,6)(3,6)(6,6)
|
||||||
|
+:HA#286:E (ab|a|c|bcd){1,10}(d*) ababcd (0,6)(4,5)(5,6) RE2/Go
|
||||||
|
+#:HA#287:E (ab|a|c|bcd){2,10}(d*) ababcd (0,6)(3,6)(6,6)
|
||||||
|
+:HA#287:E (ab|a|c|bcd){2,10}(d*) ababcd (0,6)(4,5)(5,6) RE2/Go
|
||||||
|
+#:HA#288:E (ab|a|c|bcd){3,10}(d*) ababcd (0,6)(3,6)(6,6)
|
||||||
|
+:HA#288:E (ab|a|c|bcd){3,10}(d*) ababcd (0,6)(4,5)(5,6) RE2/Go
|
||||||
|
:HA#289:E (ab|a|c|bcd){4,10}(d*) ababcd NOMATCH
|
||||||
|
-:HA#290:E (ab|a|c|bcd)*(d*) ababcd (0,6)(3,6)(6,6)
|
||||||
|
-:HA#291:E (ab|a|c|bcd)+(d*) ababcd (0,6)(3,6)(6,6)
|
||||||
|
+#:HA#290:E (ab|a|c|bcd)*(d*) ababcd (0,6)(3,6)(6,6)
|
||||||
|
+:HA#290:E (ab|a|c|bcd)*(d*) ababcd (0,6)(4,5)(5,6) RE2/Go
|
||||||
|
+#:HA#291:E (ab|a|c|bcd)+(d*) ababcd (0,6)(3,6)(6,6)
|
||||||
|
+:HA#291:E (ab|a|c|bcd)+(d*) ababcd (0,6)(4,5)(5,6) RE2/Go
|
Loading…
Reference in a new issue