use rstest::rstest; fn main() {} #[test_with::env(NOTHING)] #[rstest] #[case(0, 0)] #[case(1, 1)] #[case(2, 1)] #[case(3, 2)] #[case(4, 3)] fn fibonacci_test(#[case] input: u32, #[case] expected: u32) { assert_eq!(expected, fibonacci(input)) } fn fibonacci(input: u32) -> u32 { match input { 0 => 0, 1 => 1, n => fibonacci(n - 2) + fibonacci(n - 1), } }