fix: expect true was always expecting false

This commit is contained in:
Kasey White 2023-04-03 15:20:33 -04:00 committed by Kasey
parent ddf0fbfa0a
commit 8c8312a412
2 changed files with 10 additions and 4 deletions

View File

@ -1858,7 +1858,7 @@ impl<'a> CodeGenerator<'a> {
}
AssignmentKind::Expect => {
if tipo.is_bool() {
expect_stack.expect_bool(constr_name == "True", value_stack);
expect_stack.expect_bool(constructor_name == "True", value_stack);
} else if tipo.is_void() {
expect_stack.choose_unit(value_stack);
} else if tipo.is_data() {
@ -2322,8 +2322,6 @@ impl<'a> CodeGenerator<'a> {
let new_id = self.id_gen.next();
// START HERE
let mut clause_stack = expect_stack.empty_with_scope();
let mut when_stack = expect_stack.empty_with_scope();
let mut trace_stack = expect_stack.empty_with_scope();

View File

@ -1,7 +1,15 @@
test expect_positive() {
let val =
5
expect True =
expect False =
val > 0
True
}
// test expect_fail() {
// let val =
// 5
// expect True =
// val < 0
// True
// }