Fix test for expect_head_cast_data_with_tail
This commit is contained in:
parent
8b30f064a2
commit
d23a5b2f11
|
@ -1798,6 +1798,8 @@ impl<'a> CodeGenerator<'a> {
|
|||
AirTree::list_empty(
|
||||
AirTree::local_var("__list", tipo.clone()),
|
||||
then,
|
||||
AirTree::anon_func(
|
||||
vec![],
|
||||
AirTree::let_assignment(
|
||||
&item_name,
|
||||
AirTree::builtin(
|
||||
|
@ -1815,12 +1817,18 @@ impl<'a> CodeGenerator<'a> {
|
|||
defined_data_types,
|
||||
location,
|
||||
AirTree::call(
|
||||
AirTree::local_var("__curried_expect_on_list", void()),
|
||||
AirTree::local_var(
|
||||
"__curried_expect_on_list",
|
||||
void(),
|
||||
),
|
||||
void(),
|
||||
vec![AirTree::builtin(
|
||||
DefaultFunction::TailList,
|
||||
list(data()),
|
||||
vec![AirTree::local_var("__list", tipo.clone())],
|
||||
vec![AirTree::local_var(
|
||||
"__list",
|
||||
tipo.clone(),
|
||||
)],
|
||||
)],
|
||||
),
|
||||
otherwise.clone(),
|
||||
|
@ -1828,6 +1836,8 @@ impl<'a> CodeGenerator<'a> {
|
|||
otherwise,
|
||||
),
|
||||
),
|
||||
true,
|
||||
),
|
||||
),
|
||||
false,
|
||||
);
|
||||
|
|
|
@ -5318,16 +5318,19 @@ fn expect_head_cast_data_with_tail() {
|
|||
"#;
|
||||
let expect_on_list = Term::var("expect_on_list")
|
||||
.apply(Term::var("expect_on_list"))
|
||||
.apply(Term::var("__list"))
|
||||
.lambda("expect_on_list")
|
||||
.apply(
|
||||
Term::var("check_with")
|
||||
.apply(Term::var("__list"))
|
||||
.apply(Term::var("expect_on_list").apply(Term::var("expect_on_list")))
|
||||
.lambda("__list")
|
||||
.lambda("expect_on_list"),
|
||||
.lambda("expect_on_list")
|
||||
.lambda("__no_inline__"),
|
||||
)
|
||||
.lambda("check_with")
|
||||
.lambda("__list");
|
||||
.lambda("__list")
|
||||
.lambda("__no_inline__");
|
||||
|
||||
let values = Term::list_values(vec![
|
||||
Constant::Data(Data::integer(1.into())),
|
||||
|
@ -5346,7 +5349,7 @@ fn expect_head_cast_data_with_tail() {
|
|||
);
|
||||
|
||||
let check_with = Term::var("__list")
|
||||
.choose_list(
|
||||
.delayed_choose_list(
|
||||
then,
|
||||
Term::var("__head")
|
||||
.choose_data(
|
||||
|
@ -5356,14 +5359,17 @@ fn expect_head_cast_data_with_tail() {
|
|||
Term::var("__curried_expect_on_list")
|
||||
.apply(Term::tail_list().apply(Term::var("__list")))
|
||||
.lambda("_")
|
||||
.apply(Term::un_i_data().apply(Term::var("__head"))),
|
||||
.apply(Term::un_i_data().apply(Term::var("__head")))
|
||||
.delay(),
|
||||
Term::var("expect[h,j,..]:List<Int>=a"),
|
||||
)
|
||||
.force()
|
||||
.lambda("__head")
|
||||
.apply(Term::head_list().apply(Term::var("__list"))),
|
||||
)
|
||||
.lambda("__curried_expect_on_list")
|
||||
.lambda("__list");
|
||||
.lambda("__list")
|
||||
.lambda("__no_inline__");
|
||||
|
||||
let on_list = values
|
||||
.clone()
|
||||
|
@ -5383,19 +5389,18 @@ fn expect_head_cast_data_with_tail() {
|
|||
Term::var("expect[h,j,..]:List<Int>=a"),
|
||||
Term::var("expect[h,j,..]:List<Int>=a"),
|
||||
Term::var("expect_on_list")
|
||||
.apply(Term::tail_list().apply(Term::var("tail_2")))
|
||||
.apply(check_with)
|
||||
.lambda("expect_on_list")
|
||||
.apply(expect_on_list)
|
||||
.apply(Term::tail_list().apply(Term::var("tail_1")))
|
||||
.apply(check_with)
|
||||
.lambda("j")
|
||||
.apply(Term::un_i_data().apply(Term::var("__val")).delay()),
|
||||
.apply(Term::un_i_data().apply(Term::var("__val")))
|
||||
.delay(),
|
||||
Term::var("expect[h,j,..]:List<Int>=a"),
|
||||
)
|
||||
.force()
|
||||
.lambda("__val")
|
||||
.apply(Term::head_list().apply(Term::var("tail_1")))
|
||||
.lambda("tail_2")
|
||||
.apply(Term::tail_list().apply(Term::var("tail_1")))
|
||||
.delay(),
|
||||
)
|
||||
.force()
|
||||
|
@ -5408,7 +5413,8 @@ fn expect_head_cast_data_with_tail() {
|
|||
)
|
||||
.force()
|
||||
.lambda("__val")
|
||||
.apply(Term::head_list().apply(values)),
|
||||
.apply(Term::head_list().apply(values))
|
||||
.delay(),
|
||||
)
|
||||
.force()
|
||||
.delay();
|
||||
|
|
Loading…
Reference in New Issue