~pythonregexp2.7/python/issue2636-12

« back to all changes in this revision

Viewing changes to Lib/test/test_complex.py

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-06-09 14:52:42 UTC
  • mfrom: (39033.1.3 Regexp-2.6)
  • Revision ID: darklord@timehorse.com-20080609145242-9m268zc6u87rp1vp
Merged in changes from the core Regexp branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
373
373
            except (OSError, IOError):
374
374
                pass
375
375
 
 
376
    def test_getnewargs(self):
 
377
        self.assertEqual((1+2j).__getnewargs__(), (1.0, 2.0))
 
378
        self.assertEqual((1-2j).__getnewargs__(), (1.0, -2.0))
 
379
        self.assertEqual((2j).__getnewargs__(), (0.0, 2.0))
 
380
        self.assertEqual((-0j).__getnewargs__(), (0.0, -0.0))
 
381
        self.assertEqual(complex(0, INF).__getnewargs__(), (0.0, INF))
 
382
        self.assertEqual(complex(INF, 0).__getnewargs__(), (INF, 0.0))
 
383
 
376
384
    if float.__getformat__("double").startswith("IEEE"):
377
385
        def test_plus_minus_0j(self):
378
386
            # test that -0j and 0j literals are not identified