1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
|
# This tests the EBCDIC support in PCRE2. It catches cases where explicit values
# such as 0x0a have been used instead of names like CHAR_LF.
#
# This test file however is checked in to the repository encoded as ISO-8859-1,
# using a reversible mapping from EBCDIC. This lets us easily author test cases.
# However, they will only be run against a genuine EBCDIC when the input and
# output files are converted to EBCDIC.
#
# There is also a special mode, on ASCII systems, where pcre2test takes ASCII
# input (actually, ISO-8859-1), and then does the transcoding internally before
# calling the genuinely-EBCDIC version of PCRE2.
# Test default newline and variations
/^A/m
ABC
0: A
12\nABC
0: A
/^A/m,newline=any
12\nABC
0: A
12\rABC
0: A
12\r\nABC
0: A
12\x85ABC
0: A
/^A/m,newline=anycrlf
12\nABC
0: A
12\rABC
0: A
12\r\nABC
0: A
\= Expect no match
12\x85ABC
No match
# Test \h
/^A\h/
A B
0: A
A\tB
0: A\x09
A\xA0B
0: A\xa0
# Test \H
/^A\H/
AB
0: AB
A\x42B
0: AB
\= Expect no match
A B
No match
# Test \R
/^A\R/
A\nB
0: A\x0a
A\rB
0: A\x0d
A\x85B
0: A\x85
A\x0bB
0: A\x0b
A\x0cB
0: A\x0c
\= Expect no match
A B
No match
# Test \v
/^A\v/
A\nB
0: A\x0a
A\rB
0: A\x0d
A\x85B
0: A\x85
A\x0bB
0: A\x0b
A\x0cB
0: A\x0c
\= Expect no match
A B
No match
# Test \V
/^A\V/
A B
0: A
\= Expect no match
A\nB
No match
A\rB
No match
A\x85B
No match
A\x0bB
No match
A\x0cB
No match
# For repeated items, use an atomic group so that the output is the same
# for DFA matching (otherwise it may show multiple matches).
# Test \h+
/^A(?>\h+)/
A B
0: A
# Test \H+
/^A(?>\H+)/
AB
0: AB
\= Expect no match
A B
No match
# Test \R+
/^A(?>\R+)/
A\nB
0: A\x0a
A\rB
0: A\x0d
A\x85B
0: A\x85
A\x0bB
0: A\x0b
A\x0cB
0: A\x0c
\= Expect no match
A B
No match
# Test \v+
/^A(?>\v+)/
A\nB
0: A\x0a
A\rB
0: A\x0d
A\x85B
0: A\x85
A\x0bB
0: A\x0b
A\x0cB
0: A\x0c
\= Expect no match
A B
No match
# Test \V+
/^A(?>\V+)/
A B
0: A B
\= Expect no match
A\nB
No match
A\rB
No match
A\x85B
No match
A\x0bB
No match
A\x0cB
No match
# Test \c functionality
/\c@\cA\cb\cC\cd\cE\cf\cG\ch\cI\cJ\cK\cl\cm\cN\cO\cp\cq\cr\cS\cT\cV\cW\cX\cy\cZ/
\x00\x01\x02\x03\x9c\x09\x86\x7f\x97\x8d\x8e\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x9d\x08\x87\x18\x19\x92
0: \x00\x01\x02\x03\x9c\x09\x86\x7f\x97\x8d\x8e\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x9d\x08\x87\x18\x19\x92
\x00\x01\x02\x03\x9c\x09\x86\x7f\x97\x8d\x8e\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x9d\x08\x87\x18\x19\x92
0: \x00\x01\x02\x03\x9c\x09\x86\x7f\x97\x8d\x8e\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x9d\x08\x87\x18\x19\x92
#if !ebcdic-nl25
/^\x15$/
\n
0: \x0a
/\cU/
\x0a
0: \x0a
\x85
No match
#endif
/\c[\c\\c]\c^\c_/
\x8f\x1c\x1d\x1e\x1f
0: \x8f\x1c\x1d\x1e\x1f
/\c?/
A\x9fB
0: \x9f
/\c&/
Failed: error 168 at offset 3: \c must be followed by a letter or one of @[\]^_?
here: \c& |<--|
# End
|