Add from_parts test

Add a test to kill the mutant in `from_parts__unstable`
This commit is contained in:
Jamil Lambert, PhD 2025-02-11 17:08:30 +00:00
parent 3ee66c5bb8
commit 2f95064cfd
No known key found for this signature in database
GPG Key ID: 54DC29234AB5D2C0
1 changed files with 12 additions and 0 deletions

View File

@ -597,6 +597,18 @@ mod test {
}
}
#[test]
fn witness_from_parts() {
let elements = [1u8, 11, 2, 21, 22];
let witness_elements = 2;
let content = append_u32_vec(&elements, &[0, 2]);
let indices_start = elements.len();
let witness = Witness::from_parts__unstable(content.clone(), witness_elements, indices_start);
assert_eq!(witness.nth(0).unwrap(), [11_u8]);
assert_eq!(witness.nth(1).unwrap(), [21_u8, 22]);
assert_eq!(witness.size(), 6);
}
#[test]
#[cfg(feature = "serde")]
fn serde_bincode_backward_compatibility() {