From 486d55f0421a05c0aaa8f883bc15cacd212dcc19 Mon Sep 17 00:00:00 2001 From: "Jamil Lambert, PhD" Date: Thu, 6 Feb 2025 16:07:25 +0000 Subject: [PATCH] Add test to opcodes Cargo mutant found a mutant in opcodes. Add a test to kill it. --- primitives/src/opcodes.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/primitives/src/opcodes.rs b/primitives/src/opcodes.rs index bd9e8ce86..5da0295d3 100644 --- a/primitives/src/opcodes.rs +++ b/primitives/src/opcodes.rs @@ -565,6 +565,12 @@ mod tests { assert_eq!(s, " OP_NOP"); } + #[test] + fn ordinary_op_code() { + let ordinary_op = Ordinary::from_opcode(OP_PUSHDATA1).expect("0x4C"); + assert_eq!(ordinary_op.to_u8(), 0x4C_u8); + } + #[test] fn decode_pushnum() { // Test all possible opcodes