more identity reduce testing
This commit is contained in:
parent
dabaae8ca6
commit
e9122de061
|
@ -2007,6 +2007,31 @@ mod tests {
|
||||||
compare_optimization(expected, program, |p| p.identity_reducer());
|
compare_optimization(expected, program, |p| p.identity_reducer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn identity_reduce_no_inline_2() {
|
||||||
|
let program: Program<Name> = 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]
|
#[test]
|
||||||
fn inline_reduce_delay_sha() {
|
fn inline_reduce_delay_sha() {
|
||||||
let program: Program<Name> = Program {
|
let program: Program<Name> = Program {
|
||||||
|
|
Loading…
Reference in New Issue