From 85b80fbc734944d98c2f84122903964ab7412d20 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Mon, 7 Jul 2003 07:10:40 +0000 Subject: A few more tests. --- wildtest.txt | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'wildtest.txt') diff --git a/wildtest.txt b/wildtest.txt index 2f2963f4..c93f60bb 100644 --- a/wildtest.txt +++ b/wildtest.txt @@ -1,9 +1,9 @@ # Input is in the following format (all items white-space separated): # -# The first two items are 1 or 0 indicating if the wildmat call is expected -# to succeed and if fnmatch works the same way as wildmat, respectively. -# After that is a text string for the match, and a pattern string. Strings -# can be quoted in either double or single quotes, as well as backticks. +# The first two items are 1 or 0 indicating if the wildmat call is expected to +# succeed and if fnmatch works the same way as wildmat, respectively. After +# that is a text string for the match, and a pattern string. Strings can be +# quoted (if desired) in either double or single quotes, as well as backticks. # # MATCH FNMATCH_SAME "text to match" 'pattern to use' @@ -47,18 +47,30 @@ 1 1 bar/baz/foo **/foo 0 1 bar/baz/foo */foo 0 0 foo/bar/baz **/bar* +1 1 deep/foo/bar/baz **/bar/* 1 1 foo/bar/baz **/bar** +1 1 foo/bar/baz/x */bar/** +0 0 deep/foo/bar/baz/x */bar/** +1 1 deep/foo/bar/baz/x **/bar/*/* # Various additional tests 0 1 acrt a[c-c]st +1 1 acrt a[c-c]rt 0 1 ] [!]-] 1 1 a [!]-] 0 1 '' \ 0 1 \ \ +0 1 /\ */\ +1 1 /\ */\\ 1 1 foo foo 1 1 @foo @foo 0 1 foo @foo 1 1 [ab] \[ab] +1 1 [ab] [[]ab] +1 1 [ab] [[:]ab] +0 1 [ab] [[::]ab] +1 1 [ab] [[:digit]ab] +1 1 [ab] [\[:]ab] 1 1 ?a?b \??\?b 1 1 abc \a\b\c 0 1 foo '' @@ -69,7 +81,7 @@ 0 1 a [[:digit:][:upper:][:space:]] 1 1 A [[:digit:][:upper:][:space:]] 1 1 1 [[:digit:][:upper:][:space:]] -0 1 1 [[:digit:][:upper:][:spack:]] +0 1 1 [[:digit:][:upper:][:spaci:]] 1 1 ' ' [[:digit:][:upper:][:space:]] 0 1 . [[:digit:][:upper:][:space:]] 1 1 . [[:digit:][:punct:][:space:]] @@ -80,6 +92,10 @@ 1 1 … [^[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:graph:][:lower:][:print:][:punct:][:space:][:upper:][:xdigit:]] 1 1  [^[:alnum:][:alpha:][:blank:][:digit:][:graph:][:lower:][:print:][:punct:][:space:][:upper:][:xdigit:]] 1 1 . [^[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:lower:][:space:][:upper:][:xdigit:]] +1 1 5 [a-c[:digit:]x-z] +1 1 b [a-c[:digit:]x-z] +1 1 y [a-c[:digit:]x-z] +0 1 q [a-c[:digit:]x-z] # Additional tests, including some malformed wildmats 1 1 ] [\\-^] @@ -125,9 +141,13 @@ 1 1 - [,-.] 0 1 + [,-.] 0 1 -.] [,-.] +1 1 2 [\1-\3] +1 1 3 [\1-\3] +0 1 4 [\1-\3] 1 1 \ [[-\]] +1 1 [ [[-\]] +1 1 ] [[-\]] 0 1 - [[-\]] -0 1 /\ /\ # Test recursion and the abort code (use "wildtest -i" to see iteration counts) 1 1 -adobe-courier-bold-o-normal--12-120-75-75-m-70-iso8859-1 -*-*-*-*-*-*-12-*-*-*-m-*-*-* -- cgit v1.2.3