1
Fork 0
leetcode/tests/fizz_buzz.rs

16 lines
454 B
Rust
Raw Normal View History

2022-04-13 17:49:19 +00:00
use leetcode::fizz_buzz::fizz_buzz;
use test_case::test_case;
const EXAMPLE_3: &[&str] = &[
"1", "2", "Fizz", "4", "Buzz", "Fizz", "7", "8", "Fizz", "Buzz", "11",
"Fizz", "13", "14", "FizzBuzz",
];
#[test_case(3, &["1", "2", "Fizz"]; "example 1")]
#[test_case(5, &["1", "2", "Fizz", "4", "Buzz"]; "example 2")]
#[test_case(15, EXAMPLE_3; "example 3")]
fn test_fizz_buzz(input: i32, expected: &[&str]) {
assert_eq!(fizz_buzz(input), expected);
}