github的一些开源项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

184 lines
3.3 KiB

  1. # Tests of \C when Unicode support is available. Note that \C is not supported
  2. # for DFA matching in UTF mode, so this test is not run with -dfa. The output
  3. # of this test is different in 8-, 16-, and 32-bit modes. Some tests may match
  4. # in some widths and not in others.
  5. /ab\Cde/utf,info
  6. Capture group count = 0
  7. Contains \C
  8. Options: utf
  9. First code unit = 'a'
  10. Last code unit = 'e'
  11. Subject length lower bound = 2
  12. abXde
  13. 0: abXde
  14. # This should produce an error diagnostic (\C in UTF lookbehind) in 8-bit and
  15. # 16-bit modes, but not in 32-bit mode.
  16. /(?<=ab\Cde)X/utf
  17. Failed: error 136 at offset 0: \C is not allowed in a lookbehind assertion in UTF-8 mode
  18. ab!deXYZ
  19. # Autopossessification tests
  20. /\C+\X \X+\C/Bx
  21. ------------------------------------------------------------------
  22. Bra
  23. AllAny+
  24. extuni
  25. extuni+
  26. AllAny
  27. Ket
  28. End
  29. ------------------------------------------------------------------
  30. /\C+\X \X+\C/Bx,utf
  31. ------------------------------------------------------------------
  32. Bra
  33. Anybyte+
  34. extuni
  35. extuni+
  36. Anybyte
  37. Ket
  38. End
  39. ------------------------------------------------------------------
  40. /\C\X*TӅ;
  41. {0,6}\v+ F
  42. /utf
  43. \= Expect no match
  44. Ӆ\x0a
  45. No match
  46. /\C(\W?ſ)'?{{/utf
  47. \= Expect no match
  48. \\C(\\W?ſ)'?{{
  49. No match
  50. /X(\C{3})/utf
  51. X\x{1234}
  52. 0: X\x{1234}
  53. 1: \x{1234}
  54. X\x{11234}Y
  55. 0: X\x{f0}\x{91}\x{88}
  56. 1: \x{f0}\x{91}\x{88}
  57. X\x{11234}YZ
  58. 0: X\x{f0}\x{91}\x{88}
  59. 1: \x{f0}\x{91}\x{88}
  60. /X(\C{4})/utf
  61. X\x{1234}YZ
  62. 0: X\x{1234}Y
  63. 1: \x{1234}Y
  64. X\x{11234}YZ
  65. 0: X\x{11234}
  66. 1: \x{11234}
  67. X\x{11234}YZW
  68. 0: X\x{11234}
  69. 1: \x{11234}
  70. /X\C*/utf
  71. XYZabcdce
  72. 0: XYZabcdce
  73. /X\C*?/utf
  74. XYZabcde
  75. 0: X
  76. /X\C{3,5}/utf
  77. Xabcdefg
  78. 0: Xabcde
  79. X\x{1234}
  80. 0: X\x{1234}
  81. X\x{1234}YZ
  82. 0: X\x{1234}YZ
  83. X\x{1234}\x{512}
  84. 0: X\x{1234}\x{512}
  85. X\x{1234}\x{512}YZ
  86. 0: X\x{1234}\x{512}
  87. X\x{11234}Y
  88. 0: X\x{11234}Y
  89. X\x{11234}YZ
  90. 0: X\x{11234}Y
  91. X\x{11234}\x{512}
  92. 0: X\x{11234}\x{d4}
  93. X\x{11234}\x{512}YZ
  94. 0: X\x{11234}\x{d4}
  95. X\x{11234}\x{512}\x{11234}Z
  96. 0: X\x{11234}\x{d4}
  97. /X\C{3,5}?/utf
  98. Xabcdefg
  99. 0: Xabc
  100. X\x{1234}
  101. 0: X\x{1234}
  102. X\x{1234}YZ
  103. 0: X\x{1234}
  104. X\x{1234}\x{512}
  105. 0: X\x{1234}
  106. X\x{11234}Y
  107. 0: X\x{f0}\x{91}\x{88}
  108. X\x{11234}YZ
  109. 0: X\x{f0}\x{91}\x{88}
  110. X\x{11234}\x{512}YZ
  111. 0: X\x{f0}\x{91}\x{88}
  112. X\x{11234}
  113. 0: X\x{f0}\x{91}\x{88}
  114. /a\Cb/utf
  115. aXb
  116. 0: aXb
  117. a\nb
  118. 0: a\x{0a}b
  119. a\x{100}b
  120. No match
  121. /a\C\Cb/utf
  122. a\x{100}b
  123. 0: a\x{100}b
  124. a\x{12257}b
  125. No match
  126. a\x{12257}\x{11234}b
  127. No match
  128. /ab\Cde/utf
  129. abXde
  130. 0: abXde
  131. # This one is here not because it's different to Perl, but because the way
  132. # the captured single code unit is displayed. (In Perl it becomes a character,
  133. # and you can't tell the difference.)
  134. /X(\C)(.*)/utf
  135. X\x{1234}
  136. 0: X\x{1234}
  137. 1: \x{e1}
  138. 2: \x{88}\x{b4}
  139. X\nabc
  140. 0: X\x{0a}abc
  141. 1: \x{0a}
  142. 2: abc
  143. # This one is here because Perl gives out a grumbly error message (quite
  144. # correctly, but that messes up comparisons).
  145. /a\Cb/utf
  146. \= Expect no match in 8-bit mode
  147. a\x{100}b
  148. No match
  149. /^ab\C/utf,no_start_optimize
  150. \= Expect no match - tests \C at end of subject
  151. ab
  152. No match
  153. /\C[^\v]+\x80/utf
  154. [AΏBŀC]
  155. No match
  156. /\C[^\d]+\x80/utf
  157. [AΏBŀC]
  158. No match
  159. # End of testinput22