@@ -21,12 +21,12 @@ test('graphemeSegments', async t => {
2121 assert . deepEqual (
2222 [ ...graphemeSegments ( 'abc123' ) ] ,
2323 [
24- { segment : 'a' , index : 0 , input : 'abc123' , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
25- { segment : 'b' , index : 1 , input : 'abc123' , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
26- { segment : 'c' , index : 2 , input : 'abc123' , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
27- { segment : '1' , index : 3 , input : 'abc123' , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
28- { segment : '2' , index : 4 , input : 'abc123' , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
29- { segment : '3' , index : 5 , input : 'abc123' , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
24+ { segment : 'a' , index : 0 , input : 'abc123' , _hd : 'a' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
25+ { segment : 'b' , index : 1 , input : 'abc123' , _hd : 'b' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
26+ { segment : 'c' , index : 2 , input : 'abc123' , _hd : 'c' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
27+ { segment : '1' , index : 3 , input : 'abc123' , _hd : '1' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
28+ { segment : '2' , index : 4 , input : 'abc123' , _hd : '2' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
29+ { segment : '3' , index : 5 , input : 'abc123' , _hd : '3' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Any } ,
3030 ] ,
3131 ) ;
3232 } ) ;
@@ -35,10 +35,10 @@ test('graphemeSegments', async t => {
3535 assert . deepEqual (
3636 [ ...graphemeSegments ( 'a̐éö̲\r\n' ) ] ,
3737 [
38- { segment : 'a̐' , index : 0 , input : 'a̐éö̲\r\n' , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Extend } ,
39- { segment : 'é' , index : 2 , input : 'a̐éö̲\r\n' , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Extend } ,
40- { segment : 'ö̲' , index : 4 , input : 'a̐éö̲\r\n' , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Extend } ,
41- { segment : '\r\n' , index : 7 , input : 'a̐éö̲\r\n' , _catBegin : GraphemeCategory . CR , _catEnd : GraphemeCategory . LF } ,
38+ { segment : 'a̐' , index : 0 , input : 'a̐éö̲\r\n' , _hd : 'a̐' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Extend } ,
39+ { segment : 'é' , index : 2 , input : 'a̐éö̲\r\n' , _hd : 'é' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Extend } ,
40+ { segment : 'ö̲' , index : 4 , input : 'a̐éö̲\r\n' , _hd : 'ö̲' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Any , _catEnd : GraphemeCategory . Extend } ,
41+ { segment : '\r\n' , index : 7 , input : 'a̐éö̲\r\n' , _hd : '\r\n' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . CR , _catEnd : GraphemeCategory . LF } ,
4242 ] ,
4343 ) ;
4444 } ) ;
@@ -47,8 +47,8 @@ test('graphemeSegments', async t => {
4747 assert . deepEqual (
4848 [ ...graphemeSegments ( '🇷🇸🇮🇴' ) ] ,
4949 [
50- { segment : '🇷🇸' , index : 0 , input : '🇷🇸🇮🇴' , _catBegin : GraphemeCategory . Regional_Indicator , _catEnd : GraphemeCategory . Regional_Indicator } ,
51- { segment : '🇮🇴' , index : 4 , input : '🇷🇸🇮🇴' , _catBegin : GraphemeCategory . Regional_Indicator , _catEnd : GraphemeCategory . Regional_Indicator } ,
50+ { segment : '🇷🇸' , index : 0 , input : '🇷🇸🇮🇴' , _hd : '🇷🇸' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Regional_Indicator , _catEnd : GraphemeCategory . Regional_Indicator } ,
51+ { segment : '🇮🇴' , index : 4 , input : '🇷🇸🇮🇴' , _hd : '🇮🇴' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Regional_Indicator , _catEnd : GraphemeCategory . Regional_Indicator } ,
5252 ] ,
5353 ) ;
5454 } ) ;
@@ -57,8 +57,8 @@ test('graphemeSegments', async t => {
5757 assert . deepEqual (
5858 [ ...graphemeSegments ( '🇷🇸🇮' ) ] ,
5959 [
60- { segment : '🇷🇸' , index : 0 , input : '🇷🇸🇮' , _catBegin : GraphemeCategory . Regional_Indicator , _catEnd : GraphemeCategory . Regional_Indicator } ,
61- { segment : '🇮' , index : 4 , input : '🇷🇸🇮' , _catBegin : GraphemeCategory . Regional_Indicator , _catEnd : GraphemeCategory . Regional_Indicator } ,
60+ { segment : '🇷🇸' , index : 0 , input : '🇷🇸🇮' , _hd : '🇷🇸' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Regional_Indicator , _catEnd : GraphemeCategory . Regional_Indicator } ,
61+ { segment : '🇮' , index : 4 , input : '🇷🇸🇮' , _hd : '🇮' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Regional_Indicator , _catEnd : GraphemeCategory . Regional_Indicator } ,
6262 ] ,
6363 ) ;
6464 } ) ;
@@ -67,8 +67,8 @@ test('graphemeSegments', async t => {
6767 assert . deepEqual (
6868 [ ...graphemeSegments ( '👻👩👩👦👦' ) ] ,
6969 [
70- { segment : '👻' , index : 0 , input : '👻👩👩👦👦' , _catBegin : GraphemeCategory . Extended_Pictographic , _catEnd : GraphemeCategory . Extended_Pictographic } ,
71- { segment : '👩👩👦👦' , index : 2 , input : '👻👩👩👦👦' , _catBegin : GraphemeCategory . Extended_Pictographic , _catEnd : GraphemeCategory . Extended_Pictographic } ,
70+ { segment : '👻' , index : 0 , input : '👻👩👩👦👦' , _hd : '👻' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Extended_Pictographic , _catEnd : GraphemeCategory . Extended_Pictographic } ,
71+ { segment : '👩👩👦👦' , index : 2 , input : '👻👩👩👦👦' , _hd : '👩👩👦👦' . codePointAt ( 0 ) , _catBegin : GraphemeCategory . Extended_Pictographic , _catEnd : GraphemeCategory . Extended_Pictographic } ,
7272 ] ,
7373 ) ;
7474 } ) ;
0 commit comments