# This file tests the auxiliary pattern conversion features of the PCRE2 # library, in non-UTF mode. #forbid_utf #newline_default lf any anycrlf # -------- Tests of glob conversion -------- # Set the glob separator explicitly so that different OS defaults are not a # problem. Then test various errors. #pattern convert=glob_basic,convert_glob_separator=/ /abc/posix # More than one glob type is an error. /abc/convert=glob_bash # Separator must be / \ or . /a*b/convert_glob_separator=% # Can't have separator in a class "[ab/cd]" "[,-/]" /[ab/ # Length check /abc/convert_length=7 /abc/convert_length=8 # Now some actual tests /a?b[]xy]*c/ azb]1234c # Tests from the gitwildmatch list, with some additions /foo/ foo /= Expect no match bar // \ /???/ foo \= Expect no match foobar /*/ foo \ /f*/ foo f /*f/ oof \= Expect no match foo /*foo*/ foo food aprilfool /*ob*a*r*/ foobar /*ab/ aaaaaaabababab /foo\*/ foo* /foo\*bar/ \= Expect no match foobar /f\\oo/ f\\oo /*[al]?/ ball /[ten]/ \= Expect no match ten /t[a-g]n/ ten /a[]]b/ a]b /a[]-]b/ a-b a]b \= Expect no match aab /a[]a-]b/ aab /]/ ] /t[!a-g]n/ ton \= Expect no match ten '[[:alpha:]][[:digit:]][[:upper:]]' a1B '[[:digit:][:upper:][:space:]]' A 1 \ \= \= Expect no match a . '[a-c[:digit:]x-z]' 5 b y \= Expect no match q # End of gitwildmatch tests /*.j?g/ pic01.jpg .jpg pic02.jxg \= Expect no match pic03.j/g /A[+-0]B/ A+B A.B A0B \= Expect no match A/B /*x?z/ abc.xyz \= Expect no match .xyz /?x?z/ axyz \= Expect no match .xyz "[,-0]x?z" ,xyz \= Expect no match /xyz .xyz ".x*" .xabc /a[--0]z/ a-z a.z a0z \= Expect no match a/z a1z /<[a-c-d]>/ <-> /a[[:digit:].]z/ a1z a.z \= Expect no match a:z /a[[:digit].]z/ a[.]z a:.]z ad.]z /<[[:a[:digit:]b]>/ <[> <:> <9> \= Expect no match /a*b/convert_glob_separator=\ /a*b/convert_glob_separator=. /a*b/convert_glob_separator=/ #pattern convert=unset #pattern convert=posix_extended /a[[:>:]z/ /<[[:a[:digit:]b]>/ <[> <:> <9> \= Expect no match /a+\1b\\c|d[ab\c]/ /a[[:<:]]b[[:>:]]/ /<[]bc]>/ <]> /<[^]bc]>/ <.> \= Expect no match <]> /(a)\1b/ a1b \= Expect no match aab #pattern convert=unset #pattern convert=posix_basic /a*b+c\+[def](ab)\(cd\)/ /\(a\)\1b/ aab \= Expect no match a1b #pattern convert=unset /abc/ # End of testinput24