Skip to content

Commit 4a24ab2

Browse files
committed
Move duplicate_crash_2 test to semantic.rs
1 parent 4480bb5 commit 4a24ab2

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

fuzz/fuzz_targets/roundtrip_policy.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,4 @@ mod tests {
5151
extend_vec_from_hex("00", &mut a);
5252
super::do_test(&a);
5353
}
54-
55-
#[test]
56-
fn duplicate_crash_2() {
57-
let mut a = Vec::new();
58-
extend_vec_from_hex("746872657368", &mut a); // thresh
59-
super::do_test(&a);
60-
}
6154
}

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,4 +445,4 @@ pub fn script_num_size(n: usize) -> usize {
445445
fn hex_script(s: &str) -> bitcoin::Script {
446446
let v: Vec<u8> = bitcoin::hashes::hex::FromHex::from_hex(s).unwrap();
447447
bitcoin::Script::from(v)
448-
}
448+
}

src/policy/semantic.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,11 @@ mod tests {
485485
)"
486486
)
487487
.is_ok());
488+
489+
assert_eq!(
490+
StringPolicy::from_str("thresh").unwrap_err().to_string(),
491+
"unexpected «thresh without args»"
492+
);
488493
}
489494

490495
#[test]

0 commit comments

Comments
 (0)