File tree 2 files changed +9
-3
lines changed 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> {
344
344
take_curr = false ;
345
345
break ;
346
346
} ,
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)
349
349
_ => {
350
350
take_curr = false ;
351
351
break ;
Original file line number Diff line number Diff line change @@ -30,7 +30,13 @@ fn test_graphemes() {
30
30
& [ "\u{600} " , "\u{20} " , "\u{20} " ] ) ,
31
31
] ;
32
32
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 ) {
34
40
// test forward iterator
35
41
assert ! ( UnicodeSegmentation :: graphemes( s, true ) . eq( g. iter( ) . cloned( ) ) ) ;
36
42
assert ! ( UnicodeSegmentation :: graphemes( s, false ) . eq( g. iter( ) . cloned( ) ) ) ;
You can’t perform that action at this time.
0 commit comments