mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
First baby steps towards implementing protocol 2: PROTO, LONG1 and LONG4.
This commit is contained in:
parent
d95c2df3a9
commit
d6c9e63af9
2 changed files with 102 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue