diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-03-15 09:36:19 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-03-15 09:36:19 +0000 |
commit | 955994e1313ab81c1db2a456b5fdf7cacb016366 (patch) | |
tree | e0366bf2c5c94172d932cfa3657d74418f005173 /posix/tst-fnmatch.input | |
parent | 0493a6d7e82806fc183a3c0b383fb95d3188b690 (diff) | |
download | glibc-955994e1313ab81c1db2a456b5fdf7cacb016366.tar.gz |
Update.
2001-03-15 Ulrich Drepper <drepper@redhat.com>
* posix/fnmatch.h (FNM_EXTMATCH): Define.
* posix/fnmatch.c (NO_LEADING_PERIOD): Define.
(posixly_correct): Move global variable here.
(INT, EXT, END): Name new functions defined in fnmatch_loop.c.
(fnmatch): Pretty printing.
* posix/fnmatch_loop.c: Add code to handle FNM_EXTMATCH.
* posix/tst-fnmatch.c: Recognize EXTMATCH flag.
* posix/tst-fnmatch.input: Add tests for extended matching.
* posix/testfnm.c: Add test for patterns with multiple ** before /.
* posix/fnmatch_loop.c: Fix problem with the test above.
Diffstat (limited to 'posix/tst-fnmatch.input')
-rw-r--r-- | posix/tst-fnmatch.input | 138 |
1 files changed, 137 insertions, 1 deletions
diff --git a/posix/tst-fnmatch.input b/posix/tst-fnmatch.input index 6add86c662..6ae0a2aa82 100644 --- a/posix/tst-fnmatch.input +++ b/posix/tst-fnmatch.input @@ -348,7 +348,7 @@ C "\\/\\$" "\\/\\$" 0 NOESCAPE # B.6 033(C) C ".asd" ".*" 0 PERIOD -C "/.asd" "*" 0 PERIOD +C "/.asd" "*" 0 PERIOD C "/as/.df" "*/?*f" 0 PERIOD C "..asd" ".[!a-z]*" 0 PERIOD @@ -370,6 +370,17 @@ C "/." "/[!a-z]" NOMATCH PATHNAME|PERIOD C "/a./.b." "/*/*" NOMATCH PATHNAME|PERIOD C "/a./.b." "/??/???" NOMATCH PATHNAME|PERIOD +# Some home-grown tests. +C "foobar" "foo*[abc]z" NOMATCH +C "foobaz" "foo*[abc][xyz]" 0 +C "foobaz" "foo?*[abc][xyz]" 0 +C "foobaz" "foo?*[abc][x/yz]" 0 +C "foobaz" "foo?*[abc]/[xyz]" NOMATCH PATHNAME +C "a" "a/" NOMATCH PATHNAME +C "a/" "a" NOMATCH PATHNAME +C "//a" "/a" NOMATCH PATHNAME +C "/a" "//a" NOMATCH PATHNAME + # Following are tests outside the scope of IEEE 2003.2 since they are using # locales other than the C locale. The main focus of the tests is on the # handling of ranges and the recognition of character (vs bytes). @@ -578,3 +589,128 @@ C "x/y/z" "x/y" 0 PATHNAME|LEADING_DIR C "x" "x?y" NOMATCH PATHNAME|LEADING_DIR C "x/y" "x?y" NOMATCH PATHNAME|LEADING_DIR C "x/y/z" "x?y" NOMATCH PATHNAME|LEADING_DIR + +# ksh style matching. +C "abcd" "?@(a|b)*@(c)d" 0 EXTMATCH +C "/dev/udp/129.22.8.102/45" "/dev/@(tcp|udp)/*/*" 0 PATHNAME|EXTMATCH +C "12" "[1-9]*([0-9])" 0 EXTMATCH +C "12abc" "[1-9]*([0-9])" NOMATCH EXTMATCH +C "1" "[1-9]*([0-9])" 0 EXTMATCH +C "07" "+([0-7])" 0 EXTMATCH +C "0377" "+([0-7])" 0 EXTMATCH +C "09" "+([0-7])" NOMATCH EXTMATCH +C "paragraph" "para@(chute|graph)" 0 EXTMATCH +C "paramour" "para@(chute|graph)" NOMATCH EXTMATCH +C "para991" "para?([345]|99)1" 0 EXTMATCH +C "para381" "para?([345]|99)1" NOMATCH EXTMATCH +C "paragraph" "para*([0-9])" NOMATCH EXTMATCH +C "para" "para*([0-9])" 0 EXTMATCH +C "para13829383746592" "para*([0-9])" 0 EXTMATCH +C "paragraph" "para+([0-9])" NOMATCH EXTMATCH +C "para" "para+([0-9])" NOMATCH EXTMATCH +C "para987346523" "para+([0-9])" 0 EXTMATCH +C "paragraph" "para!(*.[0-9])" 0 EXTMATCH +C "para.38" "para!(*.[0-9])" 0 EXTMATCH +C "para.graph" "para!(*.[0-9])" 0 EXTMATCH +C "para39" "para!(*.[0-9])" 0 EXTMATCH +C "" "*(0|1|3|5|7|9)" 0 EXTMATCH +C "137577991" "*(0|1|3|5|7|9)" 0 EXTMATCH +C "2468" "*(0|1|3|5|7|9)" NOMATCH EXTMATCH +C "1358" "*(0|1|3|5|7|9)" NOMATCH EXTMATCH +C "file.c" "*.c?(c)" 0 EXTMATCH +C "file.C" "*.c?(c)" NOMATCH EXTMATCH +C "file.cc" "*.c?(c)" 0 EXTMATCH +C "file.ccc" "*.c?(c)" NOMATCH EXTMATCH +C "parse.y" "!(*.c|*.h|Makefile.in|config*|README)" 0 EXTMATCH +C "shell.c" "!(*.c|*.h|Makefile.in|config*|README)" NOMATCH EXTMATCH +C "Makefile" "!(*.c|*.h|Makefile.in|config*|README)" 0 EXTMATCH +C "VMS.FILE;1" "*\;[1-9]*([0-9])" 0 EXTMATCH +C "VMS.FILE;0" "*\;[1-9]*([0-9])" NOMATCH EXTMATCH +C "VMS.FILE;" "*\;[1-9]*([0-9])" NOMATCH EXTMATCH +C "VMS.FILE;139" "*\;[1-9]*([0-9])" 0 EXTMATCH +C "VMS.FILE;1N" "*\;[1-9]*([0-9])" NOMATCH EXTMATCH +C "abcfefg" "ab**(e|f)" 0 EXTMATCH +C "abcfefg" "ab**(e|f)g" 0 EXTMATCH +C "ab" "ab*+(e|f)" NOMATCH EXTMATCH +C "abef" "ab***ef" 0 EXTMATCH +C "abef" "ab**" 0 EXTMATCH +C "fofo" "*(f*(o))" 0 EXTMATCH +C "ffo" "*(f*(o))" 0 EXTMATCH +C "foooofo" "*(f*(o))" 0 EXTMATCH +C "foooofof" "*(f*(o))" 0 EXTMATCH +C "fooofoofofooo" "*(f*(o))" 0 EXTMATCH +C "foooofof" "*(f+(o))" NOMATCH EXTMATCH +C "xfoooofof" "*(f*(o))" NOMATCH EXTMATCH +C "foooofofx" "*(f*(o))" NOMATCH EXTMATCH +C "ofxoofxo" "*(*(of*(o)x)o)" 0 EXTMATCH +C "ofooofoofofooo" "*(f*(o))" NOMATCH EXTMATCH +C "foooxfooxfoxfooox" "*(f*(o)x)" 0 EXTMATCH +C "foooxfooxofoxfooox" "*(f*(o)x)" NOMATCH EXTMATCH +C "foooxfooxfxfooox" "*(f*(o)x)" 0 EXTMATCH +C "ofxoofxo" "*(*(of*(o)x)o)" 0 EXTMATCH +C "ofoooxoofxo" "*(*(of*(o)x)o)" 0 EXTMATCH +C "ofoooxoofxoofoooxoofxo" "*(*(of*(o)x)o)" 0 EXTMATCH +C "ofoooxoofxoofoooxoofxoo" "*(*(of*(o)x)o)" 0 EXTMATCH +C "ofoooxoofxoofoooxoofxofo" "*(*(of*(o)x)o)" NOMATCH EXTMATCH +C "ofoooxoofxoofoooxoofxooofxofxo" "*(*(of*(o)x)o)" 0 EXTMATCH +C "aac" "*(@(a))a@(c)" 0 EXTMATCH +C "ac" "*(@(a))a@(c)" 0 EXTMATCH +C "c" "*(@(a))a@(c)" NOMATCH EXTMATCH +C "aaac" "*(@(a))a@(c)" 0 EXTMATCH +C "baaac" "*(@(a))a@(c)" NOMATCH EXTMATCH +C "abcd" "?@(a|b)*@(c)d" 0 EXTMATCH +C "abcd" "@(ab|a*@(b))*(c)d" 0 EXTMATCH +C "acd" "@(ab|a*(b))*(c)d" 0 EXTMATCH +C "abbcd" "@(ab|a*(b))*(c)d" 0 EXTMATCH +C "effgz" "@(b+(c)d|e*(f)g?|?(h)i@(j|k))" 0 EXTMATCH +C "efgz" "@(b+(c)d|e*(f)g?|?(h)i@(j|k))" 0 EXTMATCH +C "egz" "@(b+(c)d|e*(f)g?|?(h)i@(j|k))" 0 EXTMATCH +C "egzefffgzbcdij" "*(b+(c)d|e*(f)g?|?(h)i@(j|k))" 0 EXTMATCH +C "egz" "@(b+(c)d|e+(f)g?|?(h)i@(j|k))" NOMATCH EXTMATCH +C "ofoofo" "*(of+(o))" 0 EXTMATCH +C "oxfoxoxfox" "*(oxf+(ox))" 0 EXTMATCH +C "oxfoxfox" "*(oxf+(ox))" NOMATCH EXTMATCH +C "ofoofo" "*(of+(o)|f)" 0 EXTMATCH +C "foofoofo" "@(foo|f|fo)*(f|of+(o))" 0 EXTMATCH +C "oofooofo" "*(of|oof+(o))" 0 EXTMATCH +C "fffooofoooooffoofffooofff" "*(*(f)*(o))" 0 EXTMATCH +C "fofoofoofofoo" "*(fo|foo)" 0 EXTMATCH +C "foo" "!(x)" 0 EXTMATCH +C "foo" "!(x)*" 0 EXTMATCH +C "foo" "!(foo)" NOMATCH EXTMATCH +C "foo" "!(foo)*" 0 EXTMATCH +C "foobar" "!(foo)" 0 EXTMATCH +C "foobar" "!(foo)*" 0 EXTMATCH +C "moo.cow" "!(*.*).!(*.*)" 0 EXTMATCH +C "mad.moo.cow" "!(*.*).!(*.*)" NOMATCH EXTMATCH +C "mucca.pazza" "mu!(*(c))?.pa!(*(z))?" NOMATCH EXTMATCH +C "fff" "!(f)" 0 EXTMATCH +C "fff" "*(!(f))" 0 EXTMATCH +C "fff" "+(!(f))" 0 EXTMATCH +C "ooo" "!(f)" 0 EXTMATCH +C "ooo" "*(!(f))" 0 EXTMATCH +C "ooo" "+(!(f))" 0 EXTMATCH +C "foo" "!(f)" 0 EXTMATCH +C "foo" "*(!(f))" 0 EXTMATCH +C "foo" "+(!(f))" 0 EXTMATCH +C "f" "!(f)" NOMATCH EXTMATCH +C "f" "*(!(f))" NOMATCH EXTMATCH +C "f" "+(!(f))" NOMATCH EXTMATCH +C "foot" "@(!(z*)|*x)" 0 EXTMATCH +C "zoot" "@(!(z*)|*x)" NOMATCH EXTMATCH +C "foox" "@(!(z*)|*x)" 0 EXTMATCH +C "zoox" "@(!(z*)|*x)" 0 EXTMATCH +C "foo" "*(!(foo)) 0 EXTMATCH +C "foob" "!(foo)b*" NOMATCH EXTMATCH +C "foobb" "!(foo)b*" 0 EXTMATCH +C "[" "*([a[])" 0 EXTMATCH +C "]" "*([]a[])" 0 EXTMATCH +C "a" "*([]a[])" 0 EXTMATCH +C "b" "*([!]a[])" 0 EXTMATCH +C "[" "*([!]a[]|[[])" 0 EXTMATCH +C "]" "*([!]a[]|[]])" 0 EXTMATCH +C "[" "!([!]a[])" 0 EXTMATCH +C "]" "!([!]a[])" 0 EXTMATCH +C ")" "*([)])" 0 EXTMATCH +C "*" "*([*(])" 0 EXTMATCH +C "abcd" "*!(|a)cd" NOMATCH EXTMATCH |