@@ -7,12 +7,38 @@ import parseNameAliases from '../scripts/parse-name-aliases.mjs';
77import parseSimpleCaseMapping from '../scripts/parse-simple-case-mapping.mjs' ;
88import parseJoiningType from '../scripts/parse-joining-type.mjs' ;
99import parseCaseFolding from '../scripts/parse-case-folding.mjs' ;
10+ import parseScriptExtensions from '../scripts/parse-script-extensions.mjs' ;
1011import {
1112 parseBlocks ,
1213 parseDerivedCoreProperties ,
14+ parseScripts ,
1315} from '../scripts/parse-blocks-scripts-properties.mjs' ;
1416import utils from '../scripts/utils.mjs' ;
1517
18+ test ( 'Script_Extensions accepts whitespace runs for singletons and ranges' , async ( t ) => {
19+ const read = utils . readDataFile ;
20+ let source ;
21+ t . mock . method ( utils , 'readDataFile' , ( version , type ) =>
22+ type === 'script-extensions' ? source : read ( version , type ) ,
23+ ) ;
24+ for ( const separator of [ ' ' , ' ' , '\t' , ' \t ' ] ) {
25+ source = `30FC; Hira${ separator } Kana\n3031..3035; Hira${ separator } Kana\n3099; Hira${ separator } Kana\n` ;
26+ const map = await parseScriptExtensions (
27+ '18.0.0' ,
28+ await parseScripts ( '18.0.0' ) ,
29+ ) ;
30+ for ( const cp of [ 0x30fc , 0x3031 , 0x3035 , 0x3099 ] ) {
31+ t . assert . ok ( map . Hiragana . contains ( cp ) ) ;
32+ t . assert . ok ( map . Katakana . contains ( cp ) ) ;
33+ t . assert . ok ( ! map . Common . contains ( cp ) ) ;
34+ t . assert . ok ( ! map . Inherited . contains ( cp ) ) ;
35+ }
36+ t . assert . ok ( map . Hiragana . contains ( 0x3042 ) ) ;
37+ t . assert . ok ( map . Katakana . contains ( 0x30a2 ) ) ;
38+ t . assert . ok ( map . Common . contains ( 0x20 ) ) ;
39+ }
40+ } ) ;
41+
1642test ( 'Case-folding expansions accept runs of whitespace between code points' , async ( t ) => {
1743 let source ;
1844 t . mock . method ( utils , 'readDataFile' , ( ) => source ) ;
0 commit comments