Unit test debug print of witness with empty instruction

We recently fixed a bug that causes a panic if a `Witness` contains an
empty instruction. Add a unit test to verify it.
This commit is contained in:
Tobin C. Harding 2023-08-16 16:03:33 +10:00
parent e96be5ee6e
commit 84614d9997
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 10 additions and 0 deletions

View File

@ -535,6 +535,16 @@ mod test {
v v
} }
#[test]
fn witness_debug_can_display_empty_instruction() {
let witness = Witness {
witness_elements: 1,
content: append_u32_vec(vec![], &[0]),
indices_start: 2,
};
println!("{:?}", witness);
}
#[test] #[test]
fn test_push() { fn test_push() {
let mut witness = Witness::default(); let mut witness = Witness::default();