cannot_parse_oversized_slice
All checks were successful
buildbot/runtests Build done.

This commit is contained in:
AF 2023-08-04 23:37:45 +00:00
parent 40a1975e84
commit e57fe2de09

View File

@ -78,4 +78,12 @@ mod tests {
fn cannot_parse_empty_slice() { fn cannot_parse_empty_slice() {
assert_eq!(u64::parse_slice(&[]).unwrap_err(), IntParseError::Eof); assert_eq!(u64::parse_slice(&[]).unwrap_err(), IntParseError::Eof);
} }
#[test]
fn cannot_parse_oversized_slice() {
assert_eq!(
u64::parse_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0]).unwrap_err(),
IntParseError::ExtraData(1),
);
}
} }