First baby steps towards implementing protocol 2: PROTO, LONG1 and LONG4.

This commit is contained in:
Guido van Rossum 2003-01-28 03:49:52 +00:00
parent d95c2df3a9
commit d6c9e63af9
2 changed files with 102 additions and 1 deletions

View file

@ -267,6 +267,20 @@ class AbstractPickleTests(unittest.TestCase):
u = self.loads(s)
self.assertEqual(t, u)
# Tests for protocol 2
def test_long1(self):
x = 12345678910111213141516178920L
s = self.dumps(x, 2)
y = self.loads(s)
self.assertEqual(x, y)
def test_long4(self):
x = 12345678910111213141516178920L << (256*8)
s = self.dumps(x, 2)
y = self.loads(s)
self.assertEqual(x, y)
class AbstractPickleModuleTests(unittest.TestCase):
def test_dump_closed_file(self):