@@ -16,6 +16,15 @@ use std::prelude::v1::*;
1616fn test_graphemes ( ) {
1717 use testdata:: { TEST_SAME , TEST_DIFF } ;
1818
19+ pub const EXTRA_DIFF : & ' static [ ( & ' static str ,
20+ & ' static [ & ' static str ] ,
21+ & ' static [ & ' static str ] ) ] = & [
22+ // Official test suite doesn't include two Prepend chars between two other chars.
23+ ( "\u{20} \u{600} \u{600} \u{20} " ,
24+ & [ "\u{20} " , "\u{600} \u{600} \u{20} " ] ,
25+ & [ "\u{20} " , "\u{600} " , "\u{600} " , "\u{20} " ] ) ,
26+ ] ;
27+
1928 for & ( s, g) in TEST_SAME {
2029 // test forward iterator
2130 assert ! ( UnicodeSegmentation :: graphemes( s, true )
@@ -34,11 +43,11 @@ fn test_graphemes() {
3443 . all( |( a, b) | a == b) ) ;
3544 }
3645
37- for & ( s, gt, gf) in TEST_DIFF {
46+ for & ( s, gt, gf) in TEST_DIFF . iter ( ) . chain ( EXTRA_DIFF ) {
3847 // test forward iterator
3948 assert ! ( UnicodeSegmentation :: graphemes( s, true )
4049 . zip( gt. iter( ) . cloned( ) )
41- . all( |( a, b) | a == b) ) ;
50+ . all( |( a, b) | a == b) , "{:?}" , s ) ;
4251 assert ! ( UnicodeSegmentation :: graphemes( s, false )
4352 . zip( gf. iter( ) . cloned( ) )
4453 . all( |( a, b) | a == b) ) ;
0 commit comments