Add test case for tail recursion.