@@ -8,12 +8,37 @@ import parseDecompositionMapping from '../scripts/parse-decomposition-mapping.mj
88import parseIndicConjunctBreak from '../scripts/parse-indic-conjunct-break.mjs' ;
99import parseJoiningType from '../scripts/parse-joining-type.mjs' ;
1010import {
11+ parseBlocks ,
1112 parseDerivedCoreProperties ,
1213 parseDerivedNormalizationProperties ,
1314 parseProperties ,
1415 parseScripts ,
1516} from '../scripts/parse-blocks-scripts-properties.mjs' ;
1617
18+ test ( 'Block values cover Unicode, including No_Block gaps' , async ( t ) => {
19+ for ( const version of [ '2.0.14' , '3.1.0' , '18.0.0' ] ) {
20+ const blocks = await parseBlocks ( version ) ;
21+ t . assert . ok ( blocks . No_Block . contains ( 0x40000 ) , version ) ;
22+ t . assert . ok ( ! blocks . No_Block . contains ( 0x41 ) , version ) ;
23+ const ranges = Object . values ( blocks )
24+ . flatMap ( ( set ) => {
25+ const result = [ ] ;
26+ for ( let i = 0 ; i < set . data . length ; i += 2 ) {
27+ result . push ( set . data . slice ( i , i + 2 ) ) ;
28+ }
29+ return result ;
30+ } )
31+ . sort ( ( a , b ) => a [ 0 ] - b [ 0 ] ) ;
32+ let end = 0 ;
33+ for ( const [ start , next ] of ranges ) {
34+ t . assert . equal ( start , end , `${ version } : Block must partition Unicode` ) ;
35+ end = next ;
36+ }
37+ t . assert . equal ( end , 0x110000 ) ;
38+ }
39+ t . assert . equal ( await parseBlocks ( '1.1.5' ) , undefined ) ;
40+ } ) ;
41+
1742test ( 'Hangul has pairwise canonical decomposition mappings' , async ( t ) => {
1843 for ( const version of [ '2.0.14' , '3.2.0' , '18.0.0' ] ) {
1944 const { Canonical } = await parseDecompositionMapping ( version ) ;
0 commit comments