| 1 |
// Copyright 2017 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 `Emoji_Component` |
| 8 |
info: | |
| 9 |
Generated by https://github.com/mathiasbynens/unicode-property-escapes-tests |
| 10 |
Unicode v10.0.0 |
| 11 |
Emoji v5.0 (UTR51) |
| 12 |
esid: sec-static-semantics-unicodematchproperty-p |
| 13 |
features: [regexp-unicode-property-escapes] |
| 14 |
includes: [regExpUtils.js] |
| 15 |
---*/ |
| 16 |
|
| 17 |
const matchSymbols = buildString({ |
| 18 |
loneCodePoints: [ |
| 19 |
0x000023, |
| 20 |
0x00002A |
| 21 |
], |
| 22 |
ranges: [ |
| 23 |
[0x000030, 0x000039], |
| 24 |
[0x01F1E6, 0x01F1FF], |
| 25 |
[0x01F3FB, 0x01F3FF] |
| 26 |
] |
| 27 |
}); |
| 28 |
testPropertyEscapes( |
| 29 |
/^\p{Emoji_Component}+$/u, |
| 30 |
matchSymbols, |
| 31 |
"\\p{Emoji_Component}" |
| 32 |
); |
| 33 |
|
| 34 |
const nonMatchSymbols = buildString({ |
| 35 |
loneCodePoints: [], |
| 36 |
ranges: [ |
| 37 |
[0x00DC00, 0x00DFFF], |
| 38 |
[0x000000, 0x000022], |
| 39 |
[0x000024, 0x000029], |
| 40 |
[0x00002B, 0x00002F], |
| 41 |
[0x00003A, 0x00DBFF], |
| 42 |
[0x00E000, 0x01F1E5], |
| 43 |
[0x01F200, 0x01F3FA], |
| 44 |
[0x01F400, 0x10FFFF] |
| 45 |
] |
| 46 |
}); |
| 47 |
testPropertyEscapes( |
| 48 |
/^\P{Emoji_Component}+$/u, |
| 49 |
nonMatchSymbols, |
| 50 |
"\\P{Emoji_Component}" |
| 51 |
); |