From 96b72f060853c7e423a1433ce347f51421e73267 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Wed, 19 May 2021 20:14:39 +0200 Subject: [PATCH] :wrench: Argument Defaults testing --- tests/tree/fib-tail.gw | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/tree/fib-tail.gw diff --git a/tests/tree/fib-tail.gw b/tests/tree/fib-tail.gw new file mode 100644 index 00000000..4cd3c4a4 --- /dev/null +++ b/tests/tree/fib-tail.gw @@ -0,0 +1,10 @@ +#! [contains] 102334155 +fun int fib(int n, int a : 0, int b : 1) { + if (n == 0) + return a; + if (n == 1) + return b; + return fib(n - 1, b, a + b); +} + +<<< fib(40, 0) >>>; -- 2.43.0