summaryrefslogtreecommitdiff
path: root/_test
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2022-01-03 09:22:25 +0100
committerAnthon van der Neut <anthon@mnt.org>2022-01-03 09:22:25 +0100
commit25f75a2cbbc0425b722d85117cd611f498f48cea (patch)
tree448eb5d177d88a7c86ac9bfb4c3884513ad43367 /_test
parent285a927e0b675d7b67d7d893e3b86862784fb0fb (diff)
downloadruamel.yaml-25f75a2cbbc0425b722d85117cd611f498f48cea.tar.gz
fix issue 414 dateime fraction >= 99999950.17.20
Diffstat (limited to '_test')
-rw-r--r--_test/test_datetime.py13
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)