wildtest.txt 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. # Input is in the following format (all items white-space separated):
  2. #
  3. # The first two items are 1 or 0 indicating if the wildmat call is expected to
  4. # succeed and if fnmatch works the same way as wildmat, respectively. After
  5. # that is a text string for the match, and a pattern string. Strings can be
  6. # quoted (if desired) in either double or single quotes, as well as backticks.
  7. #
  8. # MATCH FNMATCH_SAME "text to match" 'pattern to use'
  9. # Basic wildmat features
  10. 1 1 foo foo
  11. 0 1 foo bar
  12. 1 1 '' ""
  13. 1 1 foo ???
  14. 0 1 foo ??
  15. 1 1 foo *
  16. 1 1 foo f*
  17. 0 1 foo *f
  18. 1 1 foo *foo*
  19. 1 1 foobar *ob*a*r*
  20. 1 1 aaaaaaabababab *ab
  21. 1 1 foo* foo\*
  22. 0 1 foobar foo\*bar
  23. 1 1 f\oo f\\oo
  24. 1 1 ball *[al]?
  25. 0 1 ten [ten]
  26. 1 1 ten **[!te]
  27. 0 1 ten **[!ten]
  28. 1 1 ten t[a-g]n
  29. 0 1 ten t[!a-g]n
  30. 1 1 ton t[!a-g]n
  31. 1 1 ton t[^a-g]n
  32. 1 1 a]b a[]]b
  33. 1 1 a-b a[]-]b
  34. 1 1 a]b a[]-]b
  35. 0 1 aab a[]-]b
  36. 1 1 aab a[]a-]b
  37. 1 1 ] ]
  38. # Extended slash-matching features
  39. 0 1 foo/baz/bar foo*bar
  40. 1 1 foo/baz/bar foo**bar
  41. 0 1 foo/bar foo?bar
  42. 0 1 foo/bar foo[/]bar
  43. 0 1 foo/bar f[^eiu][^eiu][^eiu][^eiu][^eiu]r
  44. 1 1 foo-bar f[^eiu][^eiu][^eiu][^eiu][^eiu]r
  45. 0 1 foo **/foo
  46. 1 1 /foo **/foo
  47. 1 1 bar/baz/foo **/foo
  48. 0 1 bar/baz/foo */foo
  49. 0 0 foo/bar/baz **/bar*
  50. 1 1 deep/foo/bar/baz **/bar/*
  51. 0 1 deep/foo/bar/baz/ **/bar/*
  52. 1 1 deep/foo/bar/baz/ **/bar/**
  53. 0 1 deep/foo/bar **/bar/*
  54. 1 1 deep/foo/bar/ **/bar/**
  55. 1 1 foo/bar/baz **/bar**
  56. 1 1 foo/bar/baz/x */bar/**
  57. 0 0 deep/foo/bar/baz/x */bar/**
  58. 1 1 deep/foo/bar/baz/x **/bar/*/*
  59. # Various additional tests
  60. 0 1 acrt a[c-c]st
  61. 1 1 acrt a[c-c]rt
  62. 0 1 ] [!]-]
  63. 1 1 a [!]-]
  64. 0 1 '' \
  65. 0 1 \ \
  66. 0 1 /\ */\
  67. 1 1 /\ */\\
  68. 1 1 foo foo
  69. 1 1 @foo @foo
  70. 0 1 foo @foo
  71. 1 1 [ab] \[ab]
  72. 1 1 [ab] [[]ab]
  73. 1 1 [ab] [[:]ab]
  74. 0 1 [ab] [[::]ab]
  75. 1 1 [ab] [[:digit]ab]
  76. 1 1 [ab] [\[:]ab]
  77. 1 1 ?a?b \??\?b
  78. 1 1 abc \a\b\c
  79. 0 1 foo ''
  80. 1 1 foo/bar/baz/to **/t[o]
  81. # Character class tests
  82. 1 1 a1B [[:alpha:]][[:digit:]][[:upper:]]
  83. 0 1 a [[:digit:][:upper:][:space:]]
  84. 1 1 A [[:digit:][:upper:][:space:]]
  85. 1 1 1 [[:digit:][:upper:][:space:]]
  86. 0 1 1 [[:digit:][:upper:][:spaci:]]
  87. 1 1 ' ' [[:digit:][:upper:][:space:]]
  88. 0 1 . [[:digit:][:upper:][:space:]]
  89. 1 1 . [[:digit:][:punct:][:space:]]
  90. 1 1 5 [[:xdigit:]]
  91. 1 1 f [[:xdigit:]]
  92. 1 1 D [[:xdigit:]]
  93. 1 1 _ [[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:graph:][:lower:][:print:][:punct:][:space:][:upper:][:xdigit:]]
  94. #1 1 … [^[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:graph:][:lower:][:print:][:punct:][:space:][:upper:][:xdigit:]]
  95. 1 1  [^[:alnum:][:alpha:][:blank:][:digit:][:graph:][:lower:][:print:][:punct:][:space:][:upper:][:xdigit:]]
  96. 1 1 . [^[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:lower:][:space:][:upper:][:xdigit:]]
  97. 1 1 5 [a-c[:digit:]x-z]
  98. 1 1 b [a-c[:digit:]x-z]
  99. 1 1 y [a-c[:digit:]x-z]
  100. 0 1 q [a-c[:digit:]x-z]
  101. # Additional tests, including some malformed wildmats
  102. 1 1 ] [\\-^]
  103. 0 1 [ [\\-^]
  104. 1 1 - [\-_]
  105. 1 1 ] [\]]
  106. 0 1 \] [\]]
  107. 0 1 \ [\]]
  108. 0 1 ab a[]b
  109. 0 1 a[]b a[]b
  110. 0 1 ab[ ab[
  111. 0 1 ab [!
  112. 0 1 ab [-
  113. 1 1 - [-]
  114. 0 1 - [a-
  115. 0 1 - [!a-
  116. 1 1 - [--A]
  117. 1 1 5 [--A]
  118. 1 1 ' ' '[ --]'
  119. 1 1 $ '[ --]'
  120. 1 1 - '[ --]'
  121. 0 1 0 '[ --]'
  122. 1 1 - [---]
  123. 1 1 - [------]
  124. 0 1 j [a-e-n]
  125. 1 1 - [a-e-n]
  126. 1 1 a [!------]
  127. 0 1 [ []-a]
  128. 1 1 ^ []-a]
  129. 0 1 ^ [!]-a]
  130. 1 1 [ [!]-a]
  131. 1 1 ^ [a^bc]
  132. 1 1 -b] [a-]b]
  133. 0 1 \ [\]
  134. 1 1 \ [\\]
  135. 0 1 \ [!\\]
  136. 1 1 G [A-\\]
  137. 0 1 aaabbb b*a
  138. 0 1 aabcaa *ba*
  139. 1 1 , [,]
  140. 1 1 , [\\,]
  141. 1 1 \ [\\,]
  142. 1 1 - [,-.]
  143. 0 1 + [,-.]
  144. 0 1 -.] [,-.]
  145. 1 1 2 [\1-\3]
  146. 1 1 3 [\1-\3]
  147. 0 1 4 [\1-\3]
  148. 1 1 \ [[-\]]
  149. 1 1 [ [[-\]]
  150. 1 1 ] [[-\]]
  151. 0 1 - [[-\]]
  152. # Test recursion and the abort code (use "wildtest -i" to see iteration counts)
  153. 1 1 -adobe-courier-bold-o-normal--12-120-75-75-m-70-iso8859-1 -*-*-*-*-*-*-12-*-*-*-m-*-*-*
  154. 0 1 -adobe-courier-bold-o-normal--12-120-75-75-X-70-iso8859-1 -*-*-*-*-*-*-12-*-*-*-m-*-*-*
  155. 0 1 -adobe-courier-bold-o-normal--12-120-75-75-/-70-iso8859-1 -*-*-*-*-*-*-12-*-*-*-m-*-*-*
  156. 1 1 /adobe/courier/bold/o/normal//12/120/75/75/m/70/iso8859/1 /*/*/*/*/*/*/12/*/*/*/m/*/*/*
  157. 0 1 /adobe/courier/bold/o/normal//12/120/75/75/X/70/iso8859/1 /*/*/*/*/*/*/12/*/*/*/m/*/*/*
  158. 1 1 abcd/abcdefg/abcdefghijk/abcdefghijklmnop.txt **/*a*b*g*n*t
  159. 0 1 abcd/abcdefg/abcdefghijk/abcdefghijklmnop.txtz **/*a*b*g*n*t