import unittest def recursive_fib(n): if n <= 0: raise ValueError("Input must be a positive integer") if n == 1 or n == 2: return 1 return recursive_fib(n - 1) + recursive_fib(n - 2) class TestRecursiveFibonacci(unittest.TestCase): def test_fibonacci_values(self): self.assertEqual(recursive_fib(1), 1) self.assertEqual(recursive_fib(2), 1) self.assertEqual(recursive_fib(3), 2) self.assertEqual(recursive_fib(4), 3) self.assertEqual(recursive_fib(5), 5) self.assertEqual(recursive_fib(6), 8) self.assertEqual(recursive_fib(7), 13) self.assertEqual(recursive_fib(8), 21) def test_large_fibonacci(self): self.assertEqual(recursive_fib(10), 55) self.assertEqual(recursive_fib(15), 610) def test_invalid_input(self): with self.assertRaises(ValueError): recursive_fib(0) with self.assertRaises(ValueError): recursive_fib(-5) if __name__ == "__main__": unittest.main()