@@ -191,6 +191,12 @@ def test_repr(self):
191191 self .assertEqual (repr ("\U00010000 " * 39 + "\uffff " * 4096 ),
192192 repr ("\U00010000 " * 39 + "\uffff " * 4096 ))
193193
194+ # strong right-to-left character
195+ self .assertEqual (repr ('12\u05be 34' ), r"'12\u05be34'" )
196+ self .assertEqual (repr ('12\u0608 34' ), r"'12\u060834'" )
197+ self .assertEqual (repr ('12\U00010800 34' ), r"'12\U0001080034'" )
198+ self .assertEqual (repr ('12\U00010d00 34' ), r"'12\U00010d0034'" )
199+
194200 self .assertTypedEqual (repr ('\U0001f40d ' ), "'\U0001f40d '" )
195201 self .assertTypedEqual (repr (StrSubclass ('abc' )), "'abc'" )
196202 self .assertTypedEqual (repr (WithRepr ('<abc>' )), '<abc>' )
@@ -864,9 +870,11 @@ def test_isprintable_invariant(self):
864870 for codepoint in range (sys .maxunicode + 1 ):
865871 char = chr (codepoint )
866872 category = unicodedata .category (char )
873+ bidirectional = unicodedata .bidirectional (char )
867874 self .assertEqual (char .isprintable (),
868- category [0 ] not in ('C' , 'Z' )
875+ ( category [0 ] not in ('C' , 'Z' )
869876 or char == ' ' )
877+ and bidirectional not in ('R' , 'AL' ))
870878
871879 def test_surrogates (self ):
872880 for s in ('a\uD800 b\uDFFF ' , 'a\uDFFF b\uD800 ' ,
0 commit comments