mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-06 21:25:04 +03:00
fix(test): pin Havana repeated-midnight cases to a past transition
tzdata 2026f cancelled Cuba's November 2026 DST fallback, so on hosts with current tzdata (macOS) 2026-11-01 has no repeated midnight: TestNextWeeklyRenewal_RepeatedMidnight failed and the subscription calendar cases passed without exercising the repeated midnight. Move both to 2020-11-01, a Sunday fallback on the 1st that every tzdata version agrees on. The weekly case still catches a 168-hour advance.
This commit is contained in:
@@ -10,10 +10,12 @@ func TestNextWeeklyRenewal_RepeatedMidnight(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// A past transition: tzdata 2026f cancelled Cuba's November 2026 fallback,
|
||||
// so a future one makes the result depend on the host's tzdata version.
|
||||
for _, tt := range []struct{ expiry, want string }{
|
||||
{"2026-10-25T00:00:00-04:00", "2026-11-01T00:00:00-04:00"},
|
||||
{"2026-11-01T00:00:00-04:00", "2026-11-08T00:00:00-05:00"},
|
||||
{"2026-11-01T00:00:00-05:00", "2026-11-08T00:00:00-05:00"},
|
||||
{"2020-10-25T00:00:00-04:00", "2020-11-01T00:00:00-04:00"},
|
||||
{"2020-11-01T00:00:00-04:00", "2020-11-08T00:00:00-05:00"},
|
||||
{"2020-11-01T00:00:00-05:00", "2020-11-08T00:00:00-05:00"},
|
||||
} {
|
||||
from, err := time.Parse(time.RFC3339, tt.expiry)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user