test: more simple8b tests

pull/24376/head
Edd Robinson 2019-12-11 19:21:38 +00:00
parent 3bbc86a8a0
commit bff8704a0b
1 changed files with 12 additions and 0 deletions

View File

@ -26,6 +26,18 @@ fn test_encode_mixed_sizes() {
assert_eq!(decoded.to_vec(), src, "{}", "mixed sizes");
}
#[test]
fn test_encode_mixed_sizes_alt() {
let src = vec![1, 11, 3124, 123543256, 2398567984273478];
let mut encoded = vec![];
let mut decoded = vec![];
encode_all(&src, &mut encoded).expect("failed to encode");
assert_eq!(encoded.len(), 24); // verify vector is truncated.
decode_all(&encoded, &mut decoded);
assert_eq!(decoded.to_vec(), src, "{}", "mixed sizes");
}
#[test]
fn test_encode_too_big() {
let src = vec![7, 6, 2 << 61 - 1, 4, 3, 2, 1];