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