Files
breeze/tests/statistics_date_behavior.zi
waozi b5356aaac7 Port Inbe screens, storage, and platform hosts to Ziran
Replace the remaining .kry and C application sources with Ziran modules,
move vendored dependencies to their current pointers, and add Ziran tests for
the ported hosts and policies.
2026-09-27 15:40:52 -03:00

23 lines
874 B
Ziran

#import, file "../src/screens/statistics_date_rules.zi";
#program_export
Answer :: () -> s32 {
if statistics_day_offset_from_today(20240229, 20240301) != 1 ||
statistics_day_offset_from_today(20230228, 20230301) != 1 ||
statistics_day_offset_from_today(20241231, 20250101) != 1 {
return 0
}
// These date pairs straddle daylight-saving changes in many locales.
if statistics_day_offset_from_today(20240310, 20240311) != 1 ||
statistics_day_offset_from_today(20241103, 20241104) != 1 {
return 0
}
if statistics_day_offset_from_today(20230930, 20231030) != 30 ||
statistics_day_offset_from_today(20230929, 20231030) != -1 ||
statistics_day_offset_from_today(20240230, 20240301) != -1 ||
statistics_day_offset_from_today(20240302, 20240301) != -1 {
return 0
}
return 42
}