From ca790364b6f08ee224b88c66ac83f2ce4b91f36c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Fri, 16 Feb 2018 00:59:39 +0100 Subject: [PATCH] Add test if_func_branch --- src/tests/if_func_branch.exp | 2 ++ src/tests/if_func_branch.lambda | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 src/tests/if_func_branch.exp create mode 100644 src/tests/if_func_branch.lambda diff --git a/src/tests/if_func_branch.exp b/src/tests/if_func_branch.exp new file mode 100644 index 0000000..6ed281c --- /dev/null +++ b/src/tests/if_func_branch.exp @@ -0,0 +1,2 @@ +1 +1 diff --git a/src/tests/if_func_branch.lambda b/src/tests/if_func_branch.lambda new file mode 100644 index 0000000..da08ade --- /dev/null +++ b/src/tests/if_func_branch.lambda @@ -0,0 +1,8 @@ +let succeed = fun x -> print 1 in +let fail = fun x -> print 0 in + +let true = fun x -> 0 in +let false = fun x -> 1 in + +let nothing = ifzero true 0 then succeed 0 else fail 0 in +ifzero false 0 then fail 0 else succeed 0