rockorager/zeit

Weekday.daysUntil

Closed this issue · 1 comments

Nice library !!

I think there is a little bug. The test fails for wed.daysUntil(.mon) and wed.daysUntil(.sun).

test "daysUntil" {
    const wed: Weekday = .wed;
    try std.testing.expectEqual(0, wed.daysUntil(.wed));
    try std.testing.expectEqual(6, wed.daysUntil(.tue));
    try std.testing.expectEqual(5, wed.daysUntil(.mon));
    try std.testing.expectEqual(4, wed.daysUntil(.sun));
}

Probably it has something to do with -% or +% because u3 has 8 values, not 7.