[tz] Getting current tzdb version in use

Bradley White bww at acm.org
Fri Jul 20 19:11:38 UTC 2018

On Fri, Jul 20, 2018 at 2:45 PM, Paul Eggert <eggert at cs.ucla.edu> wrote:

> Paul G wrote:
>> I want to write a test that says, "Europe/Dublin should return negative
>> DST in the winter", but that test only works with versions >= 2018e.
>> There's no really good heuristic for that - if it doesn't return negative
>> DST it's either that my version is too old or my implementation is wrong.
>> Having a version number really helps distinguish between these two.
> That test should also work for versions 2018a and 2018b. If you're running
> that test only for versions 2018e or later it won't matter that it also
> works in some earlier versions. But if you expect the test to work one way
> in 2018e-or-later and the other way in 2018d-or-earlier, you'll find that
> this expectation is not true for 2018a and 2018b.

So, the version test has to be more complicated.  So be it.

> This underscores the point that it's typically better to test for the
> feature you care about, instead of trying to infer features from version
> strings.

The feature he is trying to test is that his implementation correctly
delivers the underlying data, and that seems impossible without having some
idea what the underlying data is.  Perhaps the tests should only be run on
version-locked data, but that limits their usefulness.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mm.icann.org/pipermail/tz/attachments/20180720/b71e1755/attachment.html>

More information about the tz mailing list