12 lines
406 B
Rust
12 lines
406 B
Rust
use leetcode::isomorphic_strings::is_isomorphic;
|
|
|
|
use test_case::test_case;
|
|
|
|
#[test_case("egg", "add", true; "valid")]
|
|
#[test_case("foo", "bar", false; "invalid")]
|
|
#[test_case("badc", "baba", false; "map both ways")]
|
|
#[test_case("paper", "title", true; "different maps")]
|
|
fn test_isomorphic_strings(a: &str, b: &str, expected: bool) {
|
|
assert_eq!(is_isomorphic(a.to_string(), b.to_string()), expected);
|
|
}
|