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.

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