1
Fork 0
leetcode/tests/roman_to_integer.rs

13 lines
401 B
Rust

use leetcode::roman_to_integer::roman_to_int;
use test_case::test_case;
#[test_case("", 0; "minimum")]
#[test_case("MMMCMXCIX", 3999; "maximum")]
#[test_case("MDCLXVI", 1666; "every character")]
#[test_case("CM", 900; "with subtracting")]
#[test_case("XX", 20; "without subtracting")]
fn test_roman_to_integer(input: &str, expected: i32) {
assert_eq!(roman_to_int(input.to_string()), expected);
}