diff --git a/crates/uplc/src/optimize/shrinker.rs b/crates/uplc/src/optimize/shrinker.rs index ff1912a8..292b2055 100644 --- a/crates/uplc/src/optimize/shrinker.rs +++ b/crates/uplc/src/optimize/shrinker.rs @@ -2007,6 +2007,31 @@ mod tests { compare_optimization(expected, program, |p| p.identity_reducer()); } + #[test] + fn identity_reduce_no_inline_2() { + let program: Program = Program { + version: (1, 0, 0), + term: Term::sha2_256() + .apply(Term::var("identity").apply(Term::var("x"))) + .lambda("x") + .apply(Term::byte_string(vec![]).delay()) + .lambda(NO_INLINE) + .lambda("identity") + .apply(Term::var("y").lambda("y").lambda(NO_INLINE)), + }; + + let expected = Program { + version: (1, 0, 0), + term: Term::sha2_256() + .apply(Term::var("x")) + .lambda("x") + .apply(Term::byte_string(vec![]).delay()) + .lambda(NO_INLINE), + }; + + compare_optimization(expected, program, |p| p.identity_reducer()); + } + #[test] fn inline_reduce_delay_sha() { let program: Program = Program {