| 1 |
// Copyright 2024 Mathias Bynens. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
author: Mathias Bynens |
| 6 |
description: > |
| 7 |
Unicode property escapes for `Unified_Ideograph` |
| 8 |
info: | |
| 9 |
Generated by https://github.com/mathiasbynens/unicode-property-escapes-tests |
| 10 |
Unicode v16.0.0 |
| 11 |
esid: sec-static-semantics-unicodematchproperty-p |
| 12 |
features: [regexp-unicode-property-escapes] |
| 13 |
includes: [regExpUtils.js] |
| 14 |
---*/ |
| 15 |
|
| 16 |
const matchSymbols = buildString({ |
| 17 |
loneCodePoints: [ |
| 18 |
0x00FA11, |
| 19 |
0x00FA1F, |
| 20 |
0x00FA21 |
| 21 |
], |
| 22 |
ranges: [ |
| 23 |
[0x003400, 0x004DBF], |
| 24 |
[0x004E00, 0x009FFF], |
| 25 |
[0x00FA0E, 0x00FA0F], |
| 26 |
[0x00FA13, 0x00FA14], |
| 27 |
[0x00FA23, 0x00FA24], |
| 28 |
[0x00FA27, 0x00FA29], |
| 29 |
[0x020000, 0x02A6DF], |
| 30 |
[0x02A700, 0x02B739], |
| 31 |
[0x02B740, 0x02B81D], |
| 32 |
[0x02B820, 0x02CEA1], |
| 33 |
[0x02CEB0, 0x02EBE0], |
| 34 |
[0x02EBF0, 0x02EE5D], |
| 35 |
[0x030000, 0x03134A], |
| 36 |
[0x031350, 0x0323AF] |
| 37 |
] |
| 38 |
}); |
| 39 |
testPropertyEscapes( |
| 40 |
/^\p{Unified_Ideograph}+$/u, |
| 41 |
matchSymbols, |
| 42 |
"\\p{Unified_Ideograph}" |
| 43 |
); |
| 44 |
testPropertyEscapes( |
| 45 |
/^\p{UIdeo}+$/u, |
| 46 |
matchSymbols, |
| 47 |
"\\p{UIdeo}" |
| 48 |
); |
| 49 |
|
| 50 |
const nonMatchSymbols = buildString({ |
| 51 |
loneCodePoints: [ |
| 52 |
0x00FA10, |
| 53 |
0x00FA12, |
| 54 |
0x00FA20, |
| 55 |
0x00FA22 |
| 56 |
], |
| 57 |
ranges: [ |
| 58 |
[0x00DC00, 0x00DFFF], |
| 59 |
[0x000000, 0x0033FF], |
| 60 |
[0x004DC0, 0x004DFF], |
| 61 |
[0x00A000, 0x00DBFF], |
| 62 |
[0x00E000, 0x00FA0D], |
| 63 |
[0x00FA15, 0x00FA1E], |
| 64 |
[0x00FA25, 0x00FA26], |
| 65 |
[0x00FA2A, 0x01FFFF], |
| 66 |
[0x02A6E0, 0x02A6FF], |
| 67 |
[0x02B73A, 0x02B73F], |
| 68 |
[0x02B81E, 0x02B81F], |
| 69 |
[0x02CEA2, 0x02CEAF], |
| 70 |
[0x02EBE1, 0x02EBEF], |
| 71 |
[0x02EE5E, 0x02FFFF], |
| 72 |
[0x03134B, 0x03134F], |
| 73 |
[0x0323B0, 0x10FFFF] |
| 74 |
] |
| 75 |
}); |
| 76 |
testPropertyEscapes( |
| 77 |
/^\P{Unified_Ideograph}+$/u, |
| 78 |
nonMatchSymbols, |
| 79 |
"\\P{Unified_Ideograph}" |
| 80 |
); |
| 81 |
testPropertyEscapes( |
| 82 |
/^\P{UIdeo}+$/u, |
| 83 |
nonMatchSymbols, |
| 84 |
"\\P{UIdeo}" |
| 85 |
); |
| 86 |
|
| 87 |
reportCompare(0, 0); |