1
Fork 0
leetcode/tests/palindrome_number.rs

14 lines
411 B
Rust

use leetcode::palindrome_number::is_palindrome;
use test_case::test_case;
#[test_case(0, true; "zero")]
#[test_case(-0, true; "negative zero")]
#[test_case(1, true; "single")]
#[test_case(121, true; "simple valid")]
#[test_case(123, false; "simple invalid")]
#[test_case(-121, false; "negative invalid")]
fn test_palindrome_number(input: i32, expected: bool) {
assert_eq!(is_palindrome(input), expected);
}