diff options
author | Anthon van der Neut <anthon@mnt.org> | 2022-01-03 09:22:25 +0100 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2022-01-03 09:22:25 +0100 |
commit | 25f75a2cbbc0425b722d85117cd611f498f48cea (patch) | |
tree | 448eb5d177d88a7c86ac9bfb4c3884513ad43367 /_test | |
parent | 285a927e0b675d7b67d7d893e3b86862784fb0fb (diff) | |
download | ruamel.yaml-25f75a2cbbc0425b722d85117cd611f498f48cea.tar.gz |
fix issue 414 dateime fraction >= 99999950.17.20
Diffstat (limited to '_test')
-rw-r--r-- | _test/test_datetime.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/_test/test_datetime.py b/_test/test_datetime.py index 5874c0d..7321816 100644 --- a/_test/test_datetime.py +++ b/_test/test_datetime.py @@ -145,3 +145,16 @@ class TestDateTime: """) data = copy.deepcopy(round_trip_load(x)) assert round_trip_dump(data) == x + + def test_fraction_overflow(self): + # reported (indirectly) by Luís Ferreira + # https://sourceforge.net/p/ruamel-yaml/tickets/414/ + inp = dedent("""\ + - 2022-01-02T12:34:59.9999994 + - 2022-01-02T12:34:59.9999995 + """) + exp = dedent("""\ + - 2022-01-02T12:34:59.999999 + - 2022-01-02T12:35:00 + """) + round_trip(inp, exp) |