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.

182 lines
3.2 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-16 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. No match
  53. X\x{11234}Y
  54. 0: X\x{11234}Y
  55. 1: \x{11234}Y
  56. X\x{11234}YZ
  57. 0: X\x{11234}Y
  58. 1: \x{11234}Y
  59. /X(\C{4})/utf
  60. X\x{1234}YZ
  61. No match
  62. X\x{11234}YZ
  63. 0: X\x{11234}YZ
  64. 1: \x{11234}YZ
  65. X\x{11234}YZW
  66. 0: X\x{11234}YZ
  67. 1: \x{11234}YZ
  68. /X\C*/utf
  69. XYZabcdce
  70. 0: XYZabcdce
  71. /X\C*?/utf
  72. XYZabcde
  73. 0: X
  74. /X\C{3,5}/utf
  75. Xabcdefg
  76. 0: Xabcde
  77. X\x{1234}
  78. No match
  79. X\x{1234}YZ
  80. 0: X\x{1234}YZ
  81. X\x{1234}\x{512}
  82. No match
  83. X\x{1234}\x{512}YZ
  84. 0: X\x{1234}\x{512}YZ
  85. X\x{11234}Y
  86. 0: X\x{11234}Y
  87. X\x{11234}YZ
  88. 0: X\x{11234}YZ
  89. X\x{11234}\x{512}
  90. 0: X\x{11234}\x{512}
  91. X\x{11234}\x{512}YZ
  92. 0: X\x{11234}\x{512}YZ
  93. X\x{11234}\x{512}\x{11234}Z
  94. 0: X\x{11234}\x{512}\x{11234}
  95. /X\C{3,5}?/utf
  96. Xabcdefg
  97. 0: Xabc
  98. X\x{1234}
  99. No match
  100. X\x{1234}YZ
  101. 0: X\x{1234}YZ
  102. X\x{1234}\x{512}
  103. No match
  104. X\x{11234}Y
  105. 0: X\x{11234}Y
  106. X\x{11234}YZ
  107. 0: X\x{11234}Y
  108. X\x{11234}\x{512}YZ
  109. 0: X\x{11234}\x{512}
  110. X\x{11234}
  111. No match
  112. /a\Cb/utf
  113. aXb
  114. 0: aXb
  115. a\nb
  116. 0: a\x{0a}b
  117. a\x{100}b
  118. 0: a\x{100}b
  119. /a\C\Cb/utf
  120. a\x{100}b
  121. No match
  122. a\x{12257}b
  123. 0: a\x{12257}b
  124. a\x{12257}\x{11234}b
  125. No match
  126. /ab\Cde/utf
  127. abXde
  128. 0: abXde
  129. # This one is here not because it's different to Perl, but because the way
  130. # the captured single code unit is displayed. (In Perl it becomes a character,
  131. # and you can't tell the difference.)
  132. /X(\C)(.*)/utf
  133. X\x{1234}
  134. 0: X\x{1234}
  135. 1: \x{1234}
  136. 2:
  137. X\nabc
  138. 0: X\x{0a}abc
  139. 1: \x{0a}
  140. 2: abc
  141. # This one is here because Perl gives out a grumbly error message (quite
  142. # correctly, but that messes up comparisons).
  143. /a\Cb/utf
  144. \= Expect no match in 8-bit mode
  145. a\x{100}b
  146. 0: a\x{100}b
  147. /^ab\C/utf,no_start_optimize
  148. \= Expect no match - tests \C at end of subject
  149. ab
  150. No match
  151. /\C[^\v]+\x80/utf
  152. [AΏBŀC]
  153. No match
  154. /\C[^\d]+\x80/utf
  155. [AΏBŀC]
  156. No match
  157. # End of testinput22