aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/test_recursive_functions.sh
blob: 709cfbe11e5c578fae4df87492b9d376b157102f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
test_exit_code 0 <<'EOF'
#include "../../helpers.h"

int fib(int n) {
    if (n <= 1) {
        return 1;
    } else {
        return fib(n - 1) + fib(n - 2);
    }
}

int main() {
    ASSERT_EQ(89, fib(10));
}
EOF