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.
19 lines
788 B
Ziran
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
|
|
}
|