Issue #11576: Fixed timedelta subtraction glitch on big timedelta values

This commit is contained in:
Alexander Belopolsky 2011-04-05 22:12:22 -04:00
parent 5f511826c2
commit 07019bcaab
2 changed files with 15 additions and 7 deletions

View file

@ -231,6 +231,13 @@ class TestTimeDelta(HarmlessMixedComparison, unittest.TestCase):
eq(a//10, td(0, 7*24*360))
eq(a//3600000, td(0, 0, 7*24*1000))
# Issue #11576
eq(td(999999999, 86399, 999999) - td(999999999, 86399, 999998),
td(0, 0, 1))
eq(td(999999999, 1, 1) - td(999999999, 1, 0),
td(0, 0, 1))
def test_disallowed_computations(self):
a = timedelta(42)