diff options
Diffstat (limited to 'Lib/test/test_float.py')
-rw-r--r-- | Lib/test/test_float.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py index cabeb16c42..b52b1db9e4 100644 --- a/Lib/test/test_float.py +++ b/Lib/test/test_float.py @@ -914,6 +914,15 @@ class InfNanTest(unittest.TestCase): self.assertFalse(NAN.is_inf()) self.assertFalse((0.).is_inf()) + def test_hash_inf(self): + # the actual values here should be regarded as an + # implementation detail, but they need to be + # identical to those used in the Decimal module. + self.assertEqual(hash(float('inf')), 314159) + self.assertEqual(hash(float('-inf')), -271828) + self.assertEqual(hash(float('nan')), 0) + + fromHex = float.fromhex toHex = float.hex class HexFloatTestCase(unittest.TestCase): |