1
Fork 0
leetcode/tests/plus_one.rs

11 lines
311 B
Rust

use leetcode::plus_one::plus_one;
use test_case::test_case;
#[test_case(&[1, 2, 3], &[1, 2, 4]; "simple")]
#[test_case(&[9], &[1, 0]; "carry")]
#[test_case(&[9, 9], &[1, 0, 0]; "carry multiple")]
fn test_plus_one(input: &[i32], expected: &[i32]) {
assert_eq!(plus_one(input.to_vec()), expected.to_vec());
}