fix: make tz_name tests deterministic across DST transitions#59
Draft
Koan-Bot wants to merge 1 commit intoatoomic:mainfrom
Draft
fix: make tz_name tests deterministic across DST transitions#59Koan-Bot wants to merge 1 commit intoatoomic:mainfrom
Koan-Bot wants to merge 1 commit intoatoomic:mainfrom
Conversation
tz_name() defaults its $dst parameter from localtime(), so tz_name(-18000) returns "cdt" during DST months and "est" outside. The test hardcoded the EST expectation, causing failures every spring. Replace the fragile implicit-DST test with explicit $dst parameter tests that produce the same result regardless of when they run. Also expand tz_name coverage: both DST states, multiple offsets, and unknown-offset numeric fallback (34 tests, up from 28). Fixes atoomic#58
|
seems to fix the issue I had with ADT set as the timezone |
Grinnz
approved these changes
Mar 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fix
t/zone.ttest failure that occurs every spring when DST starts.Why
tz_name(-18000)defaults its$dstparameter fromlocaltime(), returning "cdt" during DST months instead of the expected "est". The test hardcoded EST, making it fail predictably every March. Reported in #58.How
Replaced the implicit-DST
tz_nametest with explicit$dstparameter calls —tz_name(-18000, 0)for standard time,tz_name(-18000, 1)for daylight. This tests the actual disambiguation logic while being deterministic regardless of when the suite runs.Also expanded
tz_namecoverage: both DST states for shared offsets, single-entry offsets (JST, PST, PDT), offset-0 with both flags, and unknown-offset numeric fallback. 34 tests total (up from 28).Testing
prove -l t/— 913 tests pass (all 8 test files).Fixes #58
Quality Report
Changes: 1 file changed, 20 insertions(+), 4 deletions(-)
Code scan: clean
Tests: skipped
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline