1
Fork 0
leetcode/tests/missing_number.rs

10 lines
283 B
Rust

use leetcode::missing_number::missing_number;
use test_case::test_case;
#[test_case(&[0, 1, 3], 2; "sorted")]
#[test_case(&[9, 6, 4, 2, 3, 5, 7, 0, 1], 8; "unsorted")]
fn test_missing_number(input: &[i32], expected: i32) {
assert_eq!(missing_number(input.to_vec()), expected);
}