Tests update.

This commit is contained in:
Philip.Hazel 2017-05-19 16:41:10 +00:00
parent 095924ee65
commit b704c0828f
4 changed files with 61 additions and 68 deletions

View File

@ -27,9 +27,9 @@
# Length check # Length check
/abc/convert_length=7 /abc/convert_length=11
/abc/convert_length=8 /abc/convert_length=12
# Now some actual tests # Now some actual tests
@ -98,13 +98,15 @@
/a[]]b/ /a[]]b/
a]b a]b
/a[]a-]b/
/a[]-]b/ /a[]-]b/
a-b a-b
a]b a]b
\= Expect no match \= Expect no match
aab aab
/a[]a-]b/ /a[]a-z]b/
aab aab
/]/ /]/

View File

@ -10,9 +10,9 @@
#pattern convert=glob_basic,convert_glob_separator=/ #pattern convert=glob_basic,convert_glob_separator=/
# The fact that this one works in 9 bytes in the 8-bit library shows that the # The fact that this one works in 13 bytes in the 8-bit library shows that the
# output is in UTF-8, though pcre2test shows the character as an escape. # output is in UTF-8, though pcre2test shows the character as an escape.
/'>' c4 a3 '<'/hex,utf,convert_length=9 /'>' c4 a3 '<'/hex,utf,convert_length=13
# End of testinput25 # End of testinput25

111
testdata/testoutput24 vendored
View File

@ -22,26 +22,26 @@
# Can't have separator in a class # Can't have separator in a class
"[ab/cd]" "[ab/cd]"
** Pattern conversion error at offset 3: invalid syntax (?s)\A(?!/)[ab/cd]\z
"[,-/]" "[,-/]"
** Pattern conversion error at offset 3: invalid syntax (?s)\A(?!/)[,-/]\z
/[ab/ /[ab/
** Pattern conversion error at offset 3: missing terminating ] for character class ** Pattern conversion error at offset 3: missing terminating ] for character class
# Length check # Length check
/abc/convert_length=7 /abc/convert_length=11
** Pattern conversion error at offset 3: no more memory ** Pattern conversion error at offset 3: no more memory
/abc/convert_length=8 /abc/convert_length=12
\Aabc\z (?s)\Aabc\z
# Now some actual tests # Now some actual tests
/a?b[]xy]*c/ /a?b[]xy]*c/
\Aa[^/]b[]xy][^/]*c\z (?s)\Aa[^/]b(?!/)[\]xy](*COMMIT)[^/]*?c\z
azb]1234c azb]1234c
0: azb]1234c 0: azb]1234c
@ -62,7 +62,7 @@ No match
0: 0:
/???/ /???/
\A(?!\.)[^/][^/][^/]\z (?s)\A[^/][^/][^/]\z
foo foo
0: foo 0: foo
\= Expect no match \= Expect no match
@ -70,21 +70,21 @@ No match
No match No match
/*/ /*/
(?s)\A[^\/]*?\z (?s)\A[^/]*?\z
foo foo
0: foo 0: foo
\ \
0: 0:
/f*/ /f*/
(?s)\Af(*COMMIT)[^\/]*?\z (?s)\Af(*COMMIT)[^/]*?\z
foo foo
0: foo 0: foo
f f
0: f 0: f
/*f/ /*f/
(?s)\A(?!\.).*(?<=f)\z (?s)\A[^/]*?f\z
oof oof
0: oof 0: oof
\= Expect no match \= Expect no match
@ -92,7 +92,7 @@ No match
No match No match
/*foo*/ /*foo*/
\A(?!\.)[^/]*foo[^/]*\z (?s)\A[^/]*?foo(*COMMIT)[^/]*?\z
foo foo
0: foo 0: foo
food food
@ -101,12 +101,12 @@ No match
0: aprilfool 0: aprilfool
/*ob*a*r*/ /*ob*a*r*/
\A(?!\.)[^/]*ob[^/]*a[^/]*r[^/]*\z (?s)\A[^/]*?ob(*COMMIT)[^/]*?a(*COMMIT)[^/]*?r(*COMMIT)[^/]*?\z
foobar foobar
0: foobar 0: foobar
/*ab/ /*ab/
(?s)\A(?!\.).*(?<=ab)\z (?s)\A[^/]*?ab\z
aaaaaaabababab aaaaaaabababab
0: aaaaaaabababab 0: aaaaaaabababab
@ -127,48 +127,48 @@ No match
0: f\oo 0: f\oo
/*[al]?/ /*[al]?/
(?s)\A(?!\.).*(?<=[al][^/])\z (?s)\A[^/]*?(?!/)[al][^/]\z
ball ball
0: ball 0: ball
/[ten]/ /[ten]/
\A(?!\.)[ten]\z (?s)\A(?!/)[ten]\z
\= Expect no match \= Expect no match
ten ten
No match No match
/t[a-g]n/ /t[a-g]n/
\At[a-g]n\z (?s)\At(?!/)[a-g]n\z
ten ten
0: ten 0: ten
/a[]]b/ /a[]]b/
\Aa[]]b\z (?s)\Aa(?!/)[\]]b\z
a]b a]b
0: a]b 0: a]b
/a[]-]b/
\Aa[]-]b\z
a-b
0: a-b
a]b
0: a]b
\= Expect no match
aab
No match
/a[]a-]b/ /a[]a-]b/
\Aa[]a-]b\z ** Pattern conversion error at offset 7: missing terminating ] for character class
/a[]-]b/
** Pattern conversion error at offset 6: missing terminating ] for character class
a-b
a]b
\= Expect no match
aab
/a[]a-z]b/
(?s)\Aa(?!/)[\]a-z]b\z
aab aab
0: aab 0: aab
/]/ /]/
\A\]\z (?s)\A\]\z
] ]
0: ] 0: ]
/t[!a-g]n/ /t[!a-g]n/
\At[^a-g]n\z (?s)\At[^/a-g]n\z
ton ton
0: ton 0: ton
\= Expect no match \= Expect no match
@ -176,12 +176,12 @@ No match
No match No match
'[[:alpha:]][[:digit:]][[:upper:]]' '[[:alpha:]][[:digit:]][[:upper:]]'
\A(?!\.)[[:alpha:]][[:digit:]][[:upper:]]\z (?s)\A(?!/)[[:alpha:]](?!/)[[:digit:]](?!/)[[:upper:]]\z
a1B a1B
0: a1B 0: a1B
'[[:digit:][:upper:][:space:]]' '[[:digit:][:upper:][:space:]]'
\A(?!\.)[[:digit:][:upper:][:space:]]\z (?s)\A(?!/)[[:digit:][:upper:][:space:]]\z
A A
0: A 0: A
1 1
@ -195,7 +195,7 @@ No match
No match No match
'[a-c[:digit:]x-z]' '[a-c[:digit:]x-z]'
\A(?!\.)[a-c[:digit:]x-z]\z (?s)\A(?!/)[a-c[:digit:]x-z]\z
5 5
0: 5 0: 5
b b
@ -209,11 +209,11 @@ No match
# End of gitwildmatch tests # End of gitwildmatch tests
/*.j?g/ /*.j?g/
(?s)\A(?!\.).*(?<=\.j[^/]g)\z (?s)\A[^/]*?\.j[^/]g\z
pic01.jpg pic01.jpg
0: pic01.jpg 0: pic01.jpg
.jpg .jpg
No match 0: .jpg
pic02.jxg pic02.jxg
0: pic02.jxg 0: pic02.jxg
\= Expect no match \= Expect no match
@ -221,7 +221,7 @@ No match
No match No match
/A[+-0]B/ /A[+-0]B/
\AA[+-0](?<!/)B\z (?s)\AA(?!/)[+-0]B\z
A+B A+B
0: A+B 0: A+B
A.B A.B
@ -233,38 +233,38 @@ No match
No match No match
/*x?z/ /*x?z/
(?s)\A(?!\.).*(?<=x[^/]z)\z (?s)\A[^/]*?x[^/]z\z
abc.xyz abc.xyz
0: abc.xyz 0: abc.xyz
\= Expect no match \= Expect no match
.xyz .xyz
No match 0: .xyz
/?x?z/ /?x?z/
\A(?!\.)[^/]x[^/]z\z (?s)\A[^/]x[^/]z\z
axyz axyz
0: axyz 0: axyz
\= Expect no match \= Expect no match
.xyz .xyz
No match 0: .xyz
"[,-0]x?z" "[,-0]x?z"
\A(?!\.)[,-0](?<!/)x[^/]z\z (?s)\A(?!/)[,-0]x[^/]z\z
,xyz ,xyz
0: ,xyz 0: ,xyz
\= Expect no match \= Expect no match
/xyz /xyz
No match No match
.xyz .xyz
No match 0: .xyz
".x*" ".x*"
\A\.x[^/]*\z (?s)\A\.x(*COMMIT)[^/]*?\z
.xabc .xabc
0: .xabc 0: .xabc
/a[--0]z/ /a[--0]z/
\Aa[--0](?<!/)z\z (?s)\Aa(?!/)[\--0]z\z
a-z a-z
0: a-z 0: a-z
a.z a.z
@ -278,7 +278,7 @@ No match
No match No match
/<[a-c-d]>/ /<[a-c-d]>/
\A<[a-c-d]>\z (?s)\A<(?!/)[a-c-d]>\z
<a> <a>
0: <a> 0: <a>
<b> <b>
@ -291,7 +291,7 @@ No match
0: <-> 0: <->
/a[[:digit:].]z/ /a[[:digit:].]z/
\Aa[[:digit:].]z\z (?s)\Aa(?!/)[[:digit:].]z\z
a1z a1z
0: a1z 0: a1z
a.z a.z
@ -301,38 +301,29 @@ No match
No match No match
/a[[:digit].]z/ /a[[:digit].]z/
\Aa[[:digit]\.\]z\z ** Pattern conversion error at offset 10: missing terminating ] for character class
a[.]z a[.]z
0: a[.]z
a:.]z a:.]z
0: a:.]z
ad.]z ad.]z
0: ad.]z
/<[[:a[:digit:]b]>/ /<[[:a[:digit:]b]>/
\A<[[:a[:digit:]b]>\z ** Pattern conversion error at offset 6: missing terminating ] for character class
<[> <[>
0: <[>
<:> <:>
0: <:>
<a> <a>
0: <a>
<9> <9>
0: <9>
<b> <b>
0: <b>
\= Expect no match \= Expect no match
<d> <d>
No match
/a*b/convert_glob_separator=\ /a*b/convert_glob_separator=\
\Aa[^\\]*b\z (?s)\Aa(*COMMIT)[^\\]*?b\z
/a*b/convert_glob_separator=. /a*b/convert_glob_separator=.
\Aa[^.]*b\z (?s)\Aa(*COMMIT)[^\.]*?b\z
/a*b/convert_glob_separator=/ /a*b/convert_glob_separator=/
\Aa[^/]*b\z (?s)\Aa(*COMMIT)[^/]*?b\z
# Non control character checking # Non control character checking

View File

@ -10,10 +10,10 @@
#pattern convert=glob_basic,convert_glob_separator=/ #pattern convert=glob_basic,convert_glob_separator=/
# The fact that this one works in 9 bytes in the 8-bit library shows that the # The fact that this one works in 13 bytes in the 8-bit library shows that the
# output is in UTF-8, though pcre2test shows the character as an escape. # output is in UTF-8, though pcre2test shows the character as an escape.
/'>' c4 a3 '<'/hex,utf,convert_length=9 /'>' c4 a3 '<'/hex,utf,convert_length=13
\A>\x{123}<\z (?s)\A>\x{123}<\z
# End of testinput25 # End of testinput25