13 lines
420 B
Rust
13 lines
420 B
Rust
|
use leetcode::set_mismatch::find_error_nums;
|
||
|
|
||
|
use test_case::test_case;
|
||
|
|
||
|
#[test_case(&[1, 2, 2, 4], &[2, 3]; "example 1")]
|
||
|
#[test_case(&[1, 1], &[1, 2]; "example 2")]
|
||
|
#[test_case(&[2, 2], &[2, 1]; "edge 1")]
|
||
|
#[test_case(&[3, 2, 3, 4, 6, 5], &[3, 1]; "edge 2")]
|
||
|
#[test_case(&[3, 2, 2], &[2, 1]; "edge 3")]
|
||
|
fn test_set_mismatch(input: &[i32], expected: &[i32]) {
|
||
|
assert_eq!(find_error_nums(input.to_vec()), expected);
|
||
|
}
|