timezoneLookup icon indicating copy to clipboard operation
timezoneLookup copied to clipboard

Invert iter test in geo/latlng

Open arkie opened this issue 2 years ago • 0 comments

Test query for San Fransisco, United States (Etc/GMT+8)

Noticed that San Francisco was coming up an hour off in a separate project (and then the above line in the README): it should be America/Los_Angeles instead (https://time.is/San_Francisco), I think?

Adding a log to https://github.com/evanoberholster/timezoneLookup/blob/master/timezone.go#L72 showed that the iteration was continuing passed the initial match, so I tried inverting the check which seems like it passes the added tests, but didn't verify further.

Tests require presence of the timezone.data file, but I'm assuming you didn't want those checked in (and it seemed questionable to always download and rebuild); a minimal test case could probably be build up by adding the zones in code, but that seemed beyond the scope of this PR.

Feel free to remove the test file or otherwise alter. Thanks!

arkie avatar Aug 11 '22 19:08 arkie