Preserve civil daypart clocks across DST
This commit is contained in:
@@ -43,6 +43,37 @@ func TestResolveDailyRequiresDate(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDailyRunIDsDistinguishResolvedDates(t *testing.T) {
|
||||
location := loadTestLocation(t)
|
||||
now := parseTestTime("2026-05-29T17:45:00-05:00")
|
||||
tests := []struct {
|
||||
date time.Time
|
||||
wantDate string
|
||||
}{
|
||||
{date: time.Date(2026, time.May, 30, 12, 0, 0, 0, location), wantDate: "2026-05-30"},
|
||||
{date: time.Date(2026, time.May, 31, 12, 0, 0, 0, location), wantDate: "2026-05-31"},
|
||||
}
|
||||
|
||||
runIDs := make(map[string]struct{}, len(tests))
|
||||
for _, tt := range tests {
|
||||
resolved, err := Resolve(Daily, ResolveRequest{Now: now, Location: location, Date: tt.date})
|
||||
if err != nil {
|
||||
t.Fatalf("Resolve(Daily) error = %v", err)
|
||||
}
|
||||
runID := resolved.Metadata().RunID
|
||||
if runID == "" {
|
||||
t.Fatal("Daily RunID is empty")
|
||||
}
|
||||
if !strings.HasSuffix(runID, "_"+tt.wantDate) {
|
||||
t.Fatalf("Daily RunID = %q, want resolved date %q", runID, tt.wantDate)
|
||||
}
|
||||
if _, exists := runIDs[runID]; exists {
|
||||
t.Fatalf("duplicate Daily RunID %q", runID)
|
||||
}
|
||||
runIDs[runID] = struct{}{}
|
||||
}
|
||||
}
|
||||
|
||||
func TestRegistryContainsOnlyPromptBackedReports(t *testing.T) {
|
||||
registry := DefaultRegistry()
|
||||
definitions := registry.All()
|
||||
|
||||
Reference in New Issue
Block a user