| 618 | self._test(3) |
| 619 | |
| 620 | class InterningTestCase(unittest.TestCase, HelperMixin): |
| 621 | strobj = "this is an interned string" |
| 622 | strobj = sys.intern(strobj) |
| 623 | |
| 624 | def testIntern(self): |
| 625 | s = marshal.loads(marshal.dumps(self.strobj)) |
| 626 | self.assertEqual(s, self.strobj) |
| 627 | self.assertEqual(id(s), id(self.strobj)) |
| 628 | s2 = sys.intern(s) |
| 629 | self.assertEqual(id(s2), id(s)) |
| 630 | |
| 631 | def testNoIntern(self): |
| 632 | s = marshal.loads(marshal.dumps(self.strobj, 2)) |
| 633 | self.assertEqual(s, self.strobj) |
| 634 | self.assertNotEqual(id(s), id(self.strobj)) |
| 635 | s2 = sys.intern(s) |
| 636 | self.assertNotEqual(id(s2), id(s)) |
| 637 | |
| 638 | class SliceTestCase(unittest.TestCase, HelperMixin): |
| 639 | def test_slice(self): |
nothing calls this directly
no test coverage detected
searching dependent graphs…