1
Fork 0
leetcode/tests/isomorphic_strings.rs

12 lines
406 B
Rust
Raw Normal View History

2022-04-09 18:25:08 +00:00
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);
}