[Python-checkins] python/dist/src/Lib/test pickletester.py,1.35,1.36
tim_one@users.sourceforge.net
tim_one@users.sourceforge.net
Sun, 02 Feb 2003 09:59:13 -0800
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv7126/Lib/test
Modified Files:
pickletester.py
Log Message:
Implemented proto 2 NEWTRUE and NEWFALSE in cPickle.
Index: pickletester.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/pickletester.py,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** pickletester.py 2 Feb 2003 17:26:39 -0000 1.35
--- pickletester.py 2 Feb 2003 17:59:11 -0000 1.36
***************
*** 503,506 ****
--- 503,512 ----
self.assert_(x is y, (proto, x, s, y))
+ # Test that proto >= 2 really uses the bool opcodes.
+ if proto >= 2 and x in (False, True):
+ expected = x and pickle.NEWTRUE or pickle.NEWFALSE
+ # Skip the PROTO opcode at the start.
+ self.assertEqual(s[2], expected)
+
def test_newobj_tuple(self):
x = MyTuple([1, 2, 3])