slovo/examples/projects/std-layout-local-time/src/main.slo
2026-05-22 08:38:43 +02:00

29 lines
651 B
Plaintext

(module main)
(import time (monotonic_ms sleep_ms_zero))
(fn imported_time_monotonic_non_negative () -> bool
(>= (monotonic_ms) 0))
(fn imported_time_sleep_zero_score () -> i32
(+ (sleep_ms_zero) 42))
(fn imported_time_facade_ok () -> bool
(if (imported_time_monotonic_non_negative)
(= (imported_time_sleep_zero_score) 42)
false))
(fn main () -> i32
(if (imported_time_facade_ok)
42
1))
(test "explicit local time monotonic facade"
(imported_time_monotonic_non_negative))
(test "explicit local time sleep zero facade"
(= (imported_time_sleep_zero_score) 42))
(test "explicit local time facade all"
(= (main) 42))