diff options
author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2011-04-06 02:12:22 (GMT) |
---|---|---|
committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2011-04-06 02:12:22 (GMT) |
commit | 07019bcaab87114bc2312f2b916f929c99f3c48b (patch) | |
tree | 07b6c76b3bee35c1e26801d308563050b2819f8c /Lib/test/test_datetime.py | |
parent | 5f511826c2972c0e4f5de68dba285f7472a3b5bd (diff) | |
download | cpython-07019bcaab87114bc2312f2b916f929c99f3c48b.zip cpython-07019bcaab87114bc2312f2b916f929c99f3c48b.tar.gz cpython-07019bcaab87114bc2312f2b916f929c99f3c48b.tar.bz2 |
Issue #11576: Fixed timedelta subtraction glitch on big timedelta values
Diffstat (limited to 'Lib/test/test_datetime.py')
-rw-r--r-- | Lib/test/test_datetime.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_datetime.py b/Lib/test/test_datetime.py index 1a86353..d246d60 100644 --- a/Lib/test/test_datetime.py +++ b/Lib/test/test_datetime.py @@ -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) |