| 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 `Script=Brahmi` |
| 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 |
0x01107F |
| 19 |
], |
| 20 |
ranges: [ |
| 21 |
[0x011000, 0x01104D], |
| 22 |
[0x011052, 0x011075] |
| 23 |
] |
| 24 |
}); |
| 25 |
testPropertyEscapes( |
| 26 |
/^\p{Script=Brahmi}+$/u, |
| 27 |
matchSymbols, |
| 28 |
"\\p{Script=Brahmi}" |
| 29 |
); |
| 30 |
testPropertyEscapes( |
| 31 |
/^\p{Script=Brah}+$/u, |
| 32 |
matchSymbols, |
| 33 |
"\\p{Script=Brah}" |
| 34 |
); |
| 35 |
testPropertyEscapes( |
| 36 |
/^\p{sc=Brahmi}+$/u, |
| 37 |
matchSymbols, |
| 38 |
"\\p{sc=Brahmi}" |
| 39 |
); |
| 40 |
testPropertyEscapes( |
| 41 |
/^\p{sc=Brah}+$/u, |
| 42 |
matchSymbols, |
| 43 |
"\\p{sc=Brah}" |
| 44 |
); |
| 45 |
|
| 46 |
const nonMatchSymbols = buildString({ |
| 47 |
loneCodePoints: [], |
| 48 |
ranges: [ |
| 49 |
[0x00DC00, 0x00DFFF], |
| 50 |
[0x000000, 0x00DBFF], |
| 51 |
[0x00E000, 0x010FFF], |
| 52 |
[0x01104E, 0x011051], |
| 53 |
[0x011076, 0x01107E], |
| 54 |
[0x011080, 0x10FFFF] |
| 55 |
] |
| 56 |
}); |
| 57 |
testPropertyEscapes( |
| 58 |
/^\P{Script=Brahmi}+$/u, |
| 59 |
nonMatchSymbols, |
| 60 |
"\\P{Script=Brahmi}" |
| 61 |
); |
| 62 |
testPropertyEscapes( |
| 63 |
/^\P{Script=Brah}+$/u, |
| 64 |
nonMatchSymbols, |
| 65 |
"\\P{Script=Brah}" |
| 66 |
); |
| 67 |
testPropertyEscapes( |
| 68 |
/^\P{sc=Brahmi}+$/u, |
| 69 |
nonMatchSymbols, |
| 70 |
"\\P{sc=Brahmi}" |
| 71 |
); |
| 72 |
testPropertyEscapes( |
| 73 |
/^\P{sc=Brah}+$/u, |
| 74 |
nonMatchSymbols, |
| 75 |
"\\P{sc=Brah}" |
| 76 |
); |
| 77 |
|
| 78 |
reportCompare(0, 0); |