diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2026-05-01 22:32:36 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2026-05-01 22:32:36 +0300 |
| commit | e560c40a9ce3902e655f34078382a52d9b85be1b (patch) | |
| tree | 8c8ead79a743c07940db095854a9edc447307e7e /tests/guard/guard.fwd | |
| parent | 44fb150915fee559658d2296a5ba987925d27f78 (diff) | |
| download | fwd-e560c40a9ce3902e655f34078382a52d9b85be1b.tar.gz fwd-e560c40a9ce3902e655f34078382a52d9b85be1b.zip | |
add guard test
Diffstat (limited to 'tests/guard/guard.fwd')
| -rw-r--r-- | tests/guard/guard.fwd | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/guard/guard.fwd b/tests/guard/guard.fwd new file mode 100644 index 0000000..dbde0f3 --- /dev/null +++ b/tests/guard/guard.fwd @@ -0,0 +1,21 @@ +import "../../mod/libfwdio.so" + +guard(bool cond, () err | () ok) +{ + if cond { + err(); + } else { + ok(); + } +} + +main() +{ + guard(1 > 2) => { + fwdprint_str("guard or comparison broken"); + fwdprint_nl(); + } => ; + + fwdprint_str("OK"); + fwdprint_nl(); +} |
