Merge rust-bitcoin/rust-bitcoin#4019: primitives: Add test to opcodes

486d55f042 Add test to opcodes (Jamil Lambert, PhD)

Pull request description:

  Cargo mutant found a mutant in opcodes.

  Add a test to kill it.

ACKs for top commit:
  tcharding:
    ACK 486d55f042
  apoelstra:
    ACK 486d55f0421a05c0aaa8f883bc15cacd212dcc19; successfully ran local tests

Tree-SHA512: 8bd28d56d6e5d79a3531f0a3391ac26021f8351a77e632dcceb8a57b2f1cce05aa02ec5e37d5b5771c3a42a2a7010a241d8f232521678604cc6ecb4bdb3327a5
This commit is contained in:
merge-script 2025-02-07 20:11:16 +00:00
commit 9aef27a52b
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 6 additions and 0 deletions

View File

@ -565,6 +565,12 @@ mod tests {
assert_eq!(s, " OP_NOP"); 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] #[test]
fn decode_pushnum() { fn decode_pushnum() {
// Test all possible opcodes // Test all possible opcodes