@@ -42,7 +42,7 @@ describe('pfx()', () => {
4242 expect ( pfx ( combining , combining ) ) . toEqual ( 2 ) ;
4343 expect ( pfx ( combining + 'llo' , combining ) ) . toEqual ( 2 ) ;
4444 expect ( pfx ( 'hello' + combining , 'hello' + combining ) ) . toEqual ( 5 + 2 ) ;
45-
45+
4646 // Multiple combining marks
4747 const multiCombining = 'a\u0301\u0302\u0303' ;
4848 expect ( pfx ( multiCombining , multiCombining ) ) . toEqual ( 4 ) ;
@@ -134,11 +134,11 @@ describe('sfx()', () => {
134134 test ( 'does not split grapheme clusters at boundaries' , ( ) => {
135135 const chef = '👨🍳' ;
136136 const family = '👨👩👧👦' ;
137-
137+
138138 // Ensure we don't split in the middle of a grapheme cluster
139139 expect ( sfx ( 'x' + chef , chef ) ) . toEqual ( 5 ) ; // full chef emoji
140140 expect ( sfx ( 'xy' + family , family ) ) . toEqual ( 11 ) ; // full family emoji
141-
141+
142142 // When the suffix is part of a larger grapheme, it should not match partially
143143 expect ( sfx ( '👨🍳👩' , '👩' ) ) . toEqual ( 2 ) ; // Just the woman emoji at end
144144 expect ( sfx ( 'text👨🍳' , '👨🍳' ) ) . toEqual ( 5 ) ; // Full chef emoji
@@ -445,17 +445,11 @@ describe('diff()', () => {
445445 const family = '👨👩👧👦' ;
446446 const womanTech = '👩🏽💻' ;
447447 const usFlag = '🇺🇸' ;
448- assertPatch (
449- 'Hey ' + chef + ', dinner ready?' ,
450- 'Hi ' + womanTech + ', code ready?'
451- ) ;
452- assertPatch (
453- family + ' going to ' + usFlag ,
454- family + ' staying home'
455- ) ;
448+ assertPatch ( 'Hey ' + chef + ', dinner ready?' , 'Hi ' + womanTech + ', code ready?' ) ;
449+ assertPatch ( family + ' going to ' + usFlag , family + ' staying home' ) ;
456450 assertPatch (
457451 'The ' + chef + ' from ' + usFlag + ' is amazing' ,
458- 'A ' + womanTech + ' from ' + usFlag + ' is brilliant'
452+ 'A ' + womanTech + ' from ' + usFlag + ' is brilliant' ,
459453 ) ;
460454 } ) ;
461455
@@ -556,22 +550,22 @@ describe('diffEdit()', () => {
556550 const family = '👨👩👧👦' ;
557551 const womanTech = '👩🏽💻' ;
558552 const usFlag = '🇺🇸' ;
559-
553+
560554 // Insert grapheme clusters
561555 assertDiffEdit ( '' , chef , '' ) ;
562556 assertDiffEdit ( 'Hello ' , chef , '' ) ;
563557 assertDiffEdit ( '' , chef , ' world' ) ;
564558 assertDiffEdit ( 'Hello ' , chef , ' world' ) ;
565559 assertDiffEdit ( 'Team: ' , family , ' rocks!' ) ;
566-
560+
567561 // Insert multiple grapheme clusters
568562 assertDiffEdit ( '' , chef + family , '' ) ;
569563 assertDiffEdit ( 'Coders: ' , womanTech + chef , ' win' ) ;
570-
564+
571565 // Insert with flags
572566 assertDiffEdit ( 'Made in ' , usFlag , '' ) ;
573567 assertDiffEdit ( '' , usFlag , ' USA' ) ;
574-
568+
575569 // Combining characters
576570 const combining = 'e\u0301' ;
577571 assertDiffEdit ( 'caf' , combining , '' ) ;
@@ -603,14 +597,14 @@ describe('overlap()', () => {
603597 test ( 'handles grapheme clusters' , ( ) => {
604598 const chef = '👨🍳' ;
605599 const family = '👨👩👧👦' ;
606-
600+
607601 // Overlap with grapheme clusters
608602 expect ( overlap ( 'hello' + chef , chef + 'world' ) ) . toEqual ( 5 ) ;
609603 expect ( overlap ( 'abc' + family , family + 'xyz' ) ) . toEqual ( 11 ) ;
610-
604+
611605 // No overlap when grapheme differs
612606 expect ( overlap ( 'hello' + chef , family + 'world' ) ) . toEqual ( 0 ) ;
613-
607+
614608 // Text overlap with grapheme clusters
615609 expect ( overlap ( 'prefix' + chef , chef + 'suffix' ) ) . toEqual ( 5 ) ;
616610 } ) ;
@@ -666,7 +660,7 @@ describe('Unicode edge cases', () => {
666660 assertPatch ( `hello ${ nfc } ` , `hello ${ nfd } ` ) ;
667661 } ) ;
668662
669- test ( 'handles complex emoji with ZWJ sequences' , ( ) => {
663+ test ( 'handles complex emoji with ZWJ sequences' , ( ) => {
670664 const chefEmoji = '👨🍳' ; // chef emoji (man + ZWJ + cooking)
671665 const src = chefEmoji ;
672666 const dst = 'chef' + chefEmoji ;
0 commit comments