diff options
author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2011-04-05 20:07:38 -0400 |
---|---|---|
committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2011-04-05 20:07:38 -0400 |
commit | b6f5ec737008f5c739ba3c667e1ae01b8625488b (patch) | |
tree | c42061761133138a6e7b2a0d00d5eb50a3ab52c3 /Lib/test/datetimetester.py | |
parent | 04026cf56c32e89e4af4da6ac6068c6e5dd3c098 (diff) | |
download | cpython-git-b6f5ec737008f5c739ba3c667e1ae01b8625488b.tar.gz |
Issue #11576: Fixed timedelta subtraction glitch on big timedelta values
Diffstat (limited to 'Lib/test/datetimetester.py')
-rw-r--r-- | Lib/test/datetimetester.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py index e9ceee6d96..38f3b8f19b 100644 --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -383,6 +383,12 @@ class TestTimeDelta(HarmlessMixedComparison, unittest.TestCase): for i in range(-10, 10): eq((i*us/-3)//us, round(i/-3)) + # 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) |