Files
breeze/tests/habit_session_rules_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

19 lines
788 B
Ziran

#import, file "../src/screens/habits/habit_session_rules.zi";
#program_export
Answer :: () -> s32 {
one := habit_session_parse_seconds("1")
if !one.valid || one.seconds != 1 { return 0 }
maximum := habit_session_parse_seconds("999")
if !maximum.valid || maximum.seconds != 999 { return 0 }
padded := habit_session_parse_seconds("007")
if !padded.valid || padded.seconds != 7 { return 0 }
if habit_session_parse_seconds("").valid { return 0 }
if habit_session_parse_seconds("0").valid { return 0 }
if habit_session_parse_seconds("1000").valid { return 0 }
if habit_session_parse_seconds("5x").valid { return 0 }
if habit_session_parse_seconds(" 5").valid { return 0 }
if habit_session_parse_seconds("-5").valid { return 0 }
return 42
}