1
Fork 0
leetcode/tests/valid_palindrome.rs

12 lines
375 B
Rust

use leetcode::valid_palindrome::is_palindrome;
use test_case::test_case;
#[test_case("A man, a plan, a canal: Panama", true; "valid")]
#[test_case("race a car", false; "invalid")]
#[test_case("", true; "empty")]
#[test_case(" \t", true; "whitespace only")]
fn test_valid_palindrome(input: &str, expected: bool) {
assert_eq!(is_palindrome(input.to_string()), expected);
}