Skip to content

Commit 08afeb1

Browse files
Commit forgotten tests.
1 parent 10835ee commit 08afeb1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Lib/test/test_str.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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\u05be34'), r"'12\u05be34'")
196+
self.assertEqual(repr('12\u060834'), r"'12\u060834'")
197+
self.assertEqual(repr('12\U0001080034'), r"'12\U0001080034'")
198+
self.assertEqual(repr('12\U00010d0034'), 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\uD800b\uDFFF', 'a\uDFFFb\uD800',

0 commit comments

Comments
 (0)