Elliott Hughes | 653c210 | 2019-01-09 15:41:36 -0800 | [diff] [blame] | 1 | PCRE2 version 10.32-RC1 2018-02-19 |
Janis Danisevskis | 112c9cc | 2016-03-31 13:35:25 +0100 | [diff] [blame] | 2 | # This is a specialized test for checking, when PCRE2 is compiled with the |
| 3 | # EBCDIC option but in an ASCII environment, that newline, white space, and \c |
| 4 | # functionality is working. It catches cases where explicit values such as 0x0a |
| 5 | # have been used instead of names like CHAR_LF. Needless to say, it is not a |
| 6 | # genuine EBCDIC test! In patterns, alphabetic characters that follow a |
| 7 | # backslash must be in EBCDIC code. In data, NL, NEL, LF, ESC, and DEL must be |
| 8 | # in EBCDIC, but can of course be specified as escapes. |
| 9 | |
| 10 | # Test default newline and variations |
| 11 | |
| 12 | /^A/m |
| 13 | ABC |
| 14 | 0: A |
| 15 | 12\x15ABC |
| 16 | 0: A |
| 17 | |
| 18 | /^A/m,newline=any |
| 19 | 12\x15ABC |
| 20 | 0: A |
| 21 | 12\x0dABC |
| 22 | 0: A |
| 23 | 12\x0d\x15ABC |
| 24 | 0: A |
| 25 | 12\x25ABC |
| 26 | 0: A |
| 27 | |
| 28 | /^A/m,newline=anycrlf |
| 29 | 12\x15ABC |
| 30 | 0: A |
| 31 | 12\x0dABC |
| 32 | 0: A |
| 33 | 12\x0d\x15ABC |
| 34 | 0: A |
| 35 | ** Fail |
| 36 | No match |
| 37 | 12\x25ABC |
| 38 | No match |
| 39 | |
| 40 | # Test \h |
| 41 | |
| 42 | /^A\/ |
| 43 | A B |
| 44 | 0: A\x20 |
| 45 | A\x41B |
| 46 | 0: AA |
| 47 | |
| 48 | # Test \H |
| 49 | |
| 50 | /^A\È/ |
| 51 | AB |
| 52 | 0: AB |
| 53 | A\x42B |
| 54 | 0: AB |
| 55 | ** Fail |
| 56 | No match |
| 57 | A B |
| 58 | No match |
| 59 | A\x41B |
| 60 | No match |
| 61 | |
| 62 | # Test \R |
| 63 | |
| 64 | /^A\Ù/ |
| 65 | A\x15B |
| 66 | 0: A\x15 |
| 67 | A\x0dB |
| 68 | 0: A\x0d |
| 69 | A\x25B |
| 70 | 0: A\x25 |
| 71 | A\x0bB |
| 72 | 0: A\x0b |
| 73 | A\x0cB |
| 74 | 0: A\x0c |
| 75 | ** Fail |
| 76 | No match |
| 77 | A B |
| 78 | No match |
| 79 | |
| 80 | # Test \v |
| 81 | |
| 82 | /^A\¥/ |
| 83 | A\x15B |
| 84 | 0: A\x15 |
| 85 | A\x0dB |
| 86 | 0: A\x0d |
| 87 | A\x25B |
| 88 | 0: A\x25 |
| 89 | A\x0bB |
| 90 | 0: A\x0b |
| 91 | A\x0cB |
| 92 | 0: A\x0c |
| 93 | ** Fail |
| 94 | No match |
| 95 | A B |
| 96 | No match |
| 97 | |
| 98 | # Test \V |
| 99 | |
| 100 | /^A\å/ |
| 101 | A B |
| 102 | 0: A\x20 |
| 103 | ** Fail |
| 104 | No match |
| 105 | A\x15B |
| 106 | No match |
| 107 | A\x0dB |
| 108 | No match |
| 109 | A\x25B |
| 110 | No match |
| 111 | A\x0bB |
| 112 | No match |
| 113 | A\x0cB |
| 114 | No match |
| 115 | |
| 116 | # For repeated items, use an atomic group so that the output is the same |
| 117 | # for DFA matching (otherwise it may show multiple matches). |
| 118 | |
| 119 | # Test \h+ |
| 120 | |
| 121 | /^A(?>\+)/ |
| 122 | A B |
| 123 | 0: A\x20 |
| 124 | |
| 125 | # Test \H+ |
| 126 | |
| 127 | /^A(?>\È+)/ |
| 128 | AB |
| 129 | 0: AB |
| 130 | ** Fail |
| 131 | No match |
| 132 | A B |
| 133 | No match |
| 134 | |
| 135 | # Test \R+ |
| 136 | |
| 137 | /^A(?>\Ù+)/ |
| 138 | A\x15B |
| 139 | 0: A\x15 |
| 140 | A\x0dB |
| 141 | 0: A\x0d |
| 142 | A\x25B |
| 143 | 0: A\x25 |
| 144 | A\x0bB |
| 145 | 0: A\x0b |
| 146 | A\x0cB |
| 147 | 0: A\x0c |
| 148 | ** Fail |
| 149 | No match |
| 150 | A B |
| 151 | No match |
| 152 | |
| 153 | # Test \v+ |
| 154 | |
| 155 | /^A(?>\¥+)/ |
| 156 | A\x15B |
| 157 | 0: A\x15 |
| 158 | A\x0dB |
| 159 | 0: A\x0d |
| 160 | A\x25B |
| 161 | 0: A\x25 |
| 162 | A\x0bB |
| 163 | 0: A\x0b |
| 164 | A\x0cB |
| 165 | 0: A\x0c |
| 166 | ** Fail |
| 167 | No match |
| 168 | A B |
| 169 | No match |
| 170 | |
| 171 | # Test \V+ |
| 172 | |
| 173 | /^A(?>\å+)/ |
| 174 | A B |
| 175 | 0: A\x20B |
| 176 | ** Fail |
| 177 | No match |
| 178 | A\x15B |
| 179 | No match |
| 180 | A\x0dB |
| 181 | No match |
| 182 | A\x25B |
| 183 | No match |
| 184 | A\x0bB |
| 185 | No match |
| 186 | A\x0cB |
| 187 | No match |
| 188 | |
| 189 | # Test \c functionality |
| 190 | |
| 191 | /\@\A\b\C\d\E\f\G\h\I\J\K\l\m\N\O\p\q\r\S\T\u\V\W\X\y\Z/ |
| 192 | \x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f |
| 193 | 0: \x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a |
| 194 | |
| 195 | /\[\\\]\^\_/ |
| 196 | \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f |
| 197 | 0: \x1b\x1c\x1d\x1e\x1f |
| 198 | |
| 199 | /\?/ |
| 200 | A\xffB |
| 201 | 0: \xff |
| 202 | |
| 203 | /\&/ |
Elliott Hughes | 653c210 | 2019-01-09 15:41:36 -0800 | [diff] [blame] | 204 | Failed: error 168 at offset 3: \c\x20must\x20be\x20followed\x20by\x20a\x20letter\x20or\x20one\x20of\x20[\]^_\x3f |
Janis Danisevskis | 112c9cc | 2016-03-31 13:35:25 +0100 | [diff] [blame] | 205 | |
| 206 | # End |