16 lines
454 B
Rust
16 lines
454 B
Rust
|
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);
|
||
|
}
|