test/test_builtin.py: run most of test_type_name
The remaining failures are due to what appears to be a fundamental
difference between how RustPython and CPython handle surrogate
characters/codepoints-which-aren't-characters.  They are wrapped with
`self.assertRaises(AssertionError)` so we will notice once they start
passing.
is most likely
related.
@@ -2052,8 +2052,6 @@ class TestType(unittest.TestCase):
with self.assertRaises(TypeError):
type('a', (), dict={})
- # TODO: RUSTPYTHON
- @unittest.expectedFailure
def test_type_name(self):
for name in 'A', '\xc4', '\U0001f40d', 'B.A', '42', '':
with self.subTest(name=name):
@@ -2063,6 +2061,8 @@ class TestType(unittest.TestCase):
self.assertEqual(A.__module__, __name__)
with self.assertRaises(ValueError):
type('A\x00B', (), {})
+ # TODO: RUSTPYTHON (https://github.com/RustPython/RustPython/issues/935)
+ with self.assertRaises(AssertionError):
with self.assertRaises(ValueError):
type('A\udcdcB', (), {})
with self.assertRaises(TypeError):
@@ -2080,9 +2080,13 @@ class TestType(unittest.TestCase):
with self.assertRaises(ValueError):
A.__name__ = 'A\x00B'
self.assertEqual(A.__name__, 'C')
+ # TODO: RUSTPYTHON (https://github.com/RustPython/RustPython/issues/935)
+ with self.assertRaises(AssertionError):
with self.assertRaises(ValueError):
A.__name__ = 'A\udcdcB'
self.assertEqual(A.__name__, 'C')
+ # TODO: RUSTPYTHON: the previous __name__ set should fail but doesn't: reset it
+ A.__name__ = 'C'
with self.assertRaises(TypeError):
A.__name__ = b'A'
self.assertEqual(A.__name__, 'C')
