11import { test } from 'node:test' ;
22import parseDecompositionMapping from '../scripts/parse-decomposition-mapping.mjs' ;
33import parseIndicConjunctBreak from '../scripts/parse-indic-conjunct-break.mjs' ;
4+ import parseJoiningType from '../scripts/parse-joining-type.mjs' ;
45import {
56 parseDerivedCoreProperties ,
67 parseDerivedNormalizationProperties ,
@@ -21,6 +22,34 @@ test('Hangul has pairwise canonical decomposition mappings', async (t) => {
2122 t . assert . equal ( await parseDecompositionMapping ( '1.1.5' ) , undefined ) ;
2223} ) ;
2324
25+ test ( 'ArabicShaping fallback derives implicit joining types' , async ( t ) => {
26+ for ( const version of [ '3.2.0' , '4.0.0' , '4.0.1' ] ) {
27+ const map = await parseJoiningType ( version ) ;
28+ for ( const [ cp , type ] of [
29+ [ 0x41 , 'Non_Joining' ] ,
30+ [ 0x378 , 'Non_Joining' ] ,
31+ [ 0x300 , 'Transparent' ] ,
32+ [ 0x200e , 'Transparent' ] ,
33+ [ 0x200c , 'Non_Joining' ] ,
34+ [ 0x200d , 'Join_Causing' ] ,
35+ [ 0x628 , 'Dual_Joining' ] ,
36+ ] ) {
37+ t . assert . ok (
38+ map [ type ] . contains ( cp ) ,
39+ `${ version } : ${ cp . toString ( 16 ) } =${ type } ` ,
40+ ) ;
41+ t . assert . equal (
42+ Object . values ( map ) . filter ( ( set ) => set . contains ( cp ) ) . length ,
43+ 1 ,
44+ ) ;
45+ }
46+ if ( version !== '3.2.0' ) {
47+ t . assert . ok ( map . Non_Joining . contains ( 0x600 ) ) ;
48+ t . assert . ok ( ! map . Transparent . contains ( 0x600 ) ) ;
49+ }
50+ }
51+ } ) ;
52+
2453test ( 'Normalization mappings are not emitted as binary properties' , async ( t ) => {
2554 for ( const version of [ '15.1.0' , '16.0.0' , '17.0.0' , '18.0.0' ] ) {
2655 const binary = await parseDerivedNormalizationProperties ( version ) ;
0 commit comments