Covering missing error case

This commit is contained in:
Dennis Schwerdel 2016-07-06 21:29:42 +02:00
parent 8a239f8e1a
commit 6d38130146
1 changed files with 1 additions and 0 deletions

View File

@ -349,6 +349,7 @@ fn address_range_decode_encode() {
assert_eq!(range.write_to(&mut buf), 6);
assert_eq!(&buf[0..6], &[4, 0, 1, 2, 3, 24]);
assert_eq!((range, 6), Range::read_from(&buf).unwrap());
assert!(Range::read_from(&buf[..5]).is_err()); // Missing prefix length
buf[0] = 17;
assert!(Range::read_from(&buf).is_err());
}