MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_surrogates

Method test_surrogates

Lib/test/test_str.py:866–890  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

864 or char == ' ')
865
866 def test_surrogates(self):
867 for s in ('a\uD800b\uDFFF', 'a\uDFFFb\uD800',
868 'a\uD800b\uDFFFa', 'a\uDFFFb\uD800a'):
869 self.assertTrue(s.islower())
870 self.assertFalse(s.isupper())
871 self.assertFalse(s.istitle())
872 for s in ('A\uD800B\uDFFF', 'A\uDFFFB\uD800',
873 'A\uD800B\uDFFFA', 'A\uDFFFB\uD800A'):
874 self.assertFalse(s.islower())
875 self.assertTrue(s.isupper())
876 self.assertTrue(s.istitle())
877
878 for meth_name in ('islower', 'isupper', 'istitle'):
879 meth = getattr(str, meth_name)
880 for s in ('\uD800', '\uDFFF', '\uD800\uD800', '\uDFFF\uDFFF'):
881 self.assertFalse(meth(s), '%a.%s() is False' % (s, meth_name))
882
883 for meth_name in ('isalpha', 'isalnum', 'isdigit', 'isspace',
884 'isdecimal', 'isnumeric',
885 'isidentifier', 'isprintable'):
886 meth = getattr(str, meth_name)
887 for s in ('\uD800', '\uDFFF', '\uD800\uD800', '\uDFFF\uDFFF',
888 'a\uD800b\uDFFF', 'a\uDFFFb\uD800',
889 'a\uD800b\uDFFFa', 'a\uDFFFb\uD800a'):
890 self.assertFalse(meth(s), '%a.%s() is False' % (s, meth_name))
891
892
893 def test_lower(self):

Callers

nothing calls this directly

Calls 7

getattrFunction · 0.85
methFunction · 0.85
assertTrueMethod · 0.80
assertFalseMethod · 0.80
islowerMethod · 0.45
isupperMethod · 0.45
istitleMethod · 0.45

Tested by

no test coverage detected