summaryrefslogtreecommitdiffstats
path: root/Lib/test/pickletester.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-01-28 03:49:52 (GMT)
committerGuido van Rossum <guido@python.org>2003-01-28 03:49:52 (GMT)
commitd6c9e63af9b574389dc4e27c44642d522f1abfbf (patch)
tree0454e6285e6008ba1868df7356a35ed6655a864a /Lib/test/pickletester.py
parentd95c2df3a92dcabc5ffad48e15962fe9ff93a4d0 (diff)
downloadcpython-d6c9e63af9b574389dc4e27c44642d522f1abfbf.zip
cpython-d6c9e63af9b574389dc4e27c44642d522f1abfbf.tar.gz
cpython-d6c9e63af9b574389dc4e27c44642d522f1abfbf.tar.bz2
First baby steps towards implementing protocol 2: PROTO, LONG1 and LONG4.
Diffstat (limited to 'Lib/test/pickletester.py')
-rw-r--r--Lib/test/pickletester.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 7c031ec..85887ea 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -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):