@@ -318,7 +318,8 @@ def test_exact_type_match(self):
318318 # >>> class Int(int): pass
319319 # >>> type(loads(dumps(Int())))
320320 # <type 'int'>
321- for typ in (int , float , complex , tuple , list , dict , set , frozenset ):
321+ for typ in (int , float , complex , tuple , list , dict , set , frozenset ,
322+ imaginary ):
322323 # Note: str subclasses are not tested because they get handled
323324 # by marshal's routines for objects supporting the buffer API.
324325 subtyp = type ('subtyp' , (typ ,), {})
@@ -372,7 +373,7 @@ def readinto(self, buf):
372373 if n is not None and n > 4 :
373374 n += 10 ** 6
374375 return n
375- for value in (1.0 , 1j , b'0123456789' , '0123456789' ):
376+ for value in (1.0 , 1j , 1 + 1j , b'0123456789' , '0123456789' ):
376377 self .assertRaises (ValueError , marshal .load ,
377378 BadReader (marshal .dumps (value )))
378379
@@ -628,7 +629,7 @@ def test_write_long_to_file(self):
628629 self .assertEqual (data , b'\x78 \x56 \x34 \x12 ' )
629630
630631 def test_write_object_to_file (self ):
631- obj = ('\u20ac ' , b'abc' , 123 , 45.6 , 7 + 8j , 'long line ' * 1000 )
632+ obj = ('\u20ac ' , b'abc' , 123 , 45.6 , 7 + 8j , 122j , 'long line ' * 1000 )
632633 for v in range (marshal .version + 1 ):
633634 _testcapi .pymarshal_write_object_to_file (obj , os_helper .TESTFN , v )
634635 with open (os_helper .TESTFN , 'rb' ) as f :
@@ -665,7 +666,7 @@ def test_read_long_from_file(self):
665666 os_helper .unlink (os_helper .TESTFN )
666667
667668 def test_read_last_object_from_file (self ):
668- obj = ('\u20ac ' , b'abc' , 123 , 45.6 , 7 + 8j )
669+ obj = ('\u20ac ' , b'abc' , 123 , 45.6 , 7 + 8j , 666j )
669670 for v in range (marshal .version + 1 ):
670671 data = marshal .dumps (obj , v )
671672 with open (os_helper .TESTFN , 'wb' ) as f :
@@ -681,7 +682,7 @@ def test_read_last_object_from_file(self):
681682 os_helper .unlink (os_helper .TESTFN )
682683
683684 def test_read_object_from_file (self ):
684- obj = ('\u20ac ' , b'abc' , 123 , 45.6 , 7 + 8j )
685+ obj = ('\u20ac ' , b'abc' , 123 , 45.6 , 7 + 8j , 1j )
685686 for v in range (marshal .version + 1 ):
686687 data = marshal .dumps (obj , v )
687688 with open (os_helper .TESTFN , 'wb' ) as f :
0 commit comments