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

Class InterningTestCase

Lib/test/test_marshal.py:617–634  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

615 self._test(3)
616
617class InterningTestCase(unittest.TestCase, HelperMixin):
618 strobj = "this is an interned string"
619 strobj = sys.intern(strobj)
620
621 @unittest.expectedFailure # TODO: RUSTPYTHON
622 def testIntern(self):
623 s = marshal.loads(marshal.dumps(self.strobj))
624 self.assertEqual(s, self.strobj)
625 self.assertEqual(id(s), id(self.strobj))
626 s2 = sys.intern(s)
627 self.assertEqual(id(s2), id(s))
628
629 def testNoIntern(self):
630 s = marshal.loads(marshal.dumps(self.strobj, 2))
631 self.assertEqual(s, self.strobj)
632 self.assertNotEqual(id(s), id(self.strobj))
633 s2 = sys.intern(s)
634 self.assertNotEqual(id(s2), id(s))
635
636class SliceTestCase(unittest.TestCase, HelperMixin):
637 def test_slice(self):

Callers

nothing calls this directly

Calls 1

internMethod · 0.80

Tested by

no test coverage detected