Skip to content

Commit f556fd6

Browse files
committed
Case Sensitve Fuzz fixes
1 parent 475f6a5 commit f556fd6

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

fuzz/fuzz_targets/compile_descriptor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn do_test(data: &[u8]) {
1919
let output = desc.to_string();
2020
if let Ok(desc) = DummyScript::from_str(&output) {
2121
let rtt = desc.to_string();
22-
assert_eq!(output, rtt);
22+
assert_eq!(output.to_lowercase(), rtt.to_lowercase());
2323
} else {
2424
panic!("compiler output something unparseable: {}", output)
2525
}

fuzz/fuzz_targets/roundtrip_concrete.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn do_test(data: &[u8]) {
1515
let re = Regex::new("(\\D)1@").unwrap();
1616
let output = re.replace_all(&output, "$1");
1717
let data_str = re.replace_all(&data_str, "$1");
18-
assert_eq!(data_str, output);
18+
assert_eq!(data_str.to_lowercase(), output.to_lowercase());
1919
}
2020
}
2121

fuzz/fuzz_targets/roundtrip_descriptor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn do_test(data: &[u8]) {
1818
let normalize_aliases = multi_wrap_pkh_re.replace_all(&normalize_aliases, "$1:pkh(");
1919
let normalize_aliases = normalize_aliases.replace("c:pk_k(", "pk(").replace("c:pk_h(", "pkh(");
2020

21-
assert_eq!(normalize_aliases, output);
21+
assert_eq!(normalize_aliases.to_lowercase(), output.to_lowercase());
2222
}
2323
}
2424

fuzz/fuzz_targets/roundtrip_miniscript_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn do_test(data: &[u8]) {
2020
let normalize_aliases = multi_wrap_pkh_re.replace_all(&normalize_aliases, "$1:pkh(");
2121
let normalize_aliases = normalize_aliases.replace("c:pk_k(", "pk(").replace("c:pk_h(", "pkh(");
2222

23-
assert_eq!(normalize_aliases, output);
23+
assert_eq!(normalize_aliases.to_lowercase(), output.to_lowercase());
2424

2525
}
2626
}

fuzz/fuzz_targets/roundtrip_semantic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn do_test(data: &[u8]) {
1010
let data_str = String::from_utf8_lossy(data);
1111
if let Ok(pol) = DummyPolicy::from_str(&data_str) {
1212
let output = pol.to_string();
13-
assert_eq!(data_str, output);
13+
assert_eq!(data_str.to_lowercase(), output.to_lowercase());
1414
}
1515
}
1616

src/policy/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,13 @@ mod tests {
155155
fn concrete_policy_rtt(s: &str) {
156156
let conc = ConcretePol::from_str(s).unwrap();
157157
let output = conc.to_string();
158-
assert_eq!(s, output);
158+
assert_eq!(s.to_lowercase(), output.to_lowercase());
159159
}
160160

161161
fn semantic_policy_rtt(s: &str) {
162162
let sem = SemanticPol::from_str(s).unwrap();
163163
let output = sem.to_string();
164-
assert_eq!(s, output);
164+
assert_eq!(s.to_lowercase(), output.to_lowercase());
165165
}
166166

167167
#[test]
@@ -177,6 +177,7 @@ mod tests {
177177
//fuzzer crashes
178178
assert!(ConcretePol::from_str("thresh()").is_err());
179179
assert!(SemanticPol::from_str("thresh()").is_err());
180+
concrete_policy_rtt("ripemd160(aaaaaaaaaaaaaaaaaaaaaa0Daaaaaaaaaabaaaaa)");
180181
}
181182

182183
#[test]

0 commit comments

Comments
 (0)