Skip to content

Commit e0e6338

Browse files
committed
fuzz: in descriptor parsing regression test, try lifting the result
1 parent 0b29186 commit e0e6338

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

fuzz/fuzz_targets/regression_descriptor_parse.rs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,33 @@ fn do_test(data: &[u8]) {
1414
(Ok(x), Err(e)) => panic!("new logic parses {} as {:?}, old fails with {}", data_str, x, e),
1515
(Err(e), Ok(x)) => panic!("old logic parses {} as {:?}, new fails with {}", data_str, x, e),
1616
(Ok(new), Ok(old)) => {
17+
use miniscript::policy::Liftable as _;
18+
use old_miniscript::policy::Liftable as _;
19+
1720
assert_eq!(
1821
old.to_string(),
1922
new.to_string(),
2023
"input {} (left is old, right is new)",
2124
data_str
22-
)
25+
);
26+
27+
match (new.lift(), old.lift()) {
28+
(Err(_), Err(_)) => {}
29+
(Ok(x), Err(e)) => {
30+
panic!("new logic lifts {} as {:?}, old fails with {}", data_str, x, e)
31+
}
32+
(Err(e), Ok(x)) => {
33+
panic!("old logic lifts {} as {:?}, new fails with {}", data_str, x, e)
34+
}
35+
(Ok(new), Ok(old)) => {
36+
assert_eq!(
37+
old.to_string(),
38+
new.to_string(),
39+
"lifted input {} (left is old, right is new)",
40+
data_str
41+
)
42+
}
43+
}
2344
}
2445
}
2546
}

0 commit comments

Comments
 (0)