Skip to content

Commit 523d18b

Browse files
author
Chad Dougherty
authored
feat(try_from_into): Add insufficient length test (#469)
1 parent c52be7d commit 523d18b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

exercises/conversions/try_from_into.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,10 @@ mod tests {
127127
let v = vec![0, 0, 0, 0];
128128
let _ = Color::try_from(&v[..]).unwrap();
129129
}
130+
#[test]
131+
#[should_panic]
132+
fn test_slice_insufficient_length() {
133+
let v = vec![0, 0];
134+
let _ = Color::try_from(&v[..]).unwrap();
135+
}
130136
}

0 commit comments

Comments
 (0)