1
Fork 0
leetcode/tests/keyboard_row.rs

14 lines
414 B
Rust

use leetcode::keyboard_row::find_words;
use test_case::test_case;
#[test_case(&["Hello", "Alaska", "Dad", "Peace"], &["Alaska", "Dad"]; "example 1")]
#[test_case(&["omk"], &[]; "example 2")]
#[test_case(&["adsdf", "sfd"], &["adsdf", "sfd"]; "example 3")]
fn test_keyboard_row(input: &[&str], expected: &[&str]) {
assert_eq!(
find_words(input.iter().map(ToString::to_string).collect()),
expected
);
}