File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -344,8 +344,8 @@ impl<'a> DoubleEndedIterator for Graphemes<'a> {
344344 take_curr = false ;
345345 break ;
346346 } ,
347- Zwj => match cat { // char to right is (GAZ|EBG)
348- gr:: GC_ZWJ => continue , // rule GB11: ZWJ x (GAZ|EBG)
347+ Zwj => match cat { // char to right is (GAZ|EBG)
348+ gr:: GC_ZWJ => FindExtend , // rule GB11: ZWJ x (GAZ|EBG)
349349 _ => {
350350 take_curr = false ;
351351 break ;
Original file line number Diff line number Diff line change @@ -30,7 +30,13 @@ fn test_graphemes() {
3030 & [ "\u{600} " , "\u{20} " , "\u{20} " ] ) ,
3131 ] ;
3232
33- for & ( s, g) in TEST_SAME . iter ( ) {
33+ pub const EXTRA_SAME : & ' static [ ( & ' static str , & ' static [ & ' static str ] ) ] = & [
34+ // family emoji (more than two emoji joined by ZWJ)
35+ ( "\u{1f468} \u{200d} \u{1f467} \u{200d} \u{1f466} " ,
36+ & [ "\u{1f468} \u{200d} \u{1f467} \u{200d} \u{1f466} " ] ) ,
37+ ] ;
38+
39+ for & ( s, g) in TEST_SAME . iter ( ) . chain ( EXTRA_SAME ) {
3440 // test forward iterator
3541 assert ! ( UnicodeSegmentation :: graphemes( s, true ) . eq( g. iter( ) . cloned( ) ) ) ;
3642 assert ! ( UnicodeSegmentation :: graphemes( s, false ) . eq( g. iter( ) . cloned( ) ) ) ;
You can’t perform that action at this time.
0 commit comments