The initial implementation of Time did not handle leap seconds consistently across languages. 23:59:60 would work in Haskell but get read as 00:00:00 in Rust and Python.
Since Python's datetime package does not handle leap seconds at all and leap seconds are, in general, a massive headache, I am going to explicitly not support leap seconds in Theta. Theta will never write a leap second to a Time value and it will readTime values with a leap second as 23:59:59.999999.
This PR adds leap-second-handling logic to Haskell, Python and Rust along with tests.
I originally caught the bug when one the cross-language QuickCheck tests failed with a massive input. To help debug this, I moved Test.Assertions from a hidden module in Theta's test suite to Theta.Test.Assertions and wrote a version of assertDiff that only prints the first difference between two values (rather than the whole thing). This made finding the part of the test case that caused the failure a lot easier than needing to deal with the entire input!
The initial implementation of
Time
did not handle leap seconds consistently across languages.23:59:60
would work in Haskell but get read as00:00:00
in Rust and Python.Since Python's
datetime
package does not handle leap seconds at all and leap seconds are, in general, a massive headache, I am going to explicitly not support leap seconds in Theta. Theta will never write a leap second to aTime
value and it will readTime
values with a leap second as23:59:59.999999
.This PR adds leap-second-handling logic to Haskell, Python and Rust along with tests.
I originally caught the bug when one the cross-language QuickCheck tests failed with a massive input. To help debug this, I moved
Test.Assertions
from a hidden module in Theta's test suite toTheta.Test.Assertions
and wrote a version ofassertDiff
that only prints the first difference between two values (rather than the whole thing). This made finding the part of the test case that caused the failure a lot easier than needing to deal with the entire input!