Merge pull request #678 from rtfeldman/record-bool-tests

More REPL Improvements
This commit is contained in:
Richard Feldman 2020-11-12 00:07:18 -05:00 committed by GitHub
commit d21ffb7eee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 472 additions and 212 deletions

View file

@ -820,4 +820,28 @@ mod gen_records {
i64
);
}
#[test]
fn booleans_in_record() {
assert_evals_to!(
indoc!("{ x: 1 == 1, y: 1 == 1 }"),
(true, true),
(bool, bool)
);
assert_evals_to!(
indoc!("{ x: 1 != 1, y: 1 == 1 }"),
(false, true),
(bool, bool)
);
assert_evals_to!(
indoc!("{ x: 1 == 1, y: 1 != 1 }"),
(true, false),
(bool, bool)
);
assert_evals_to!(
indoc!("{ x: 1 != 1, y: 1 != 1 }"),
(false, false),
(bool, bool)
);
}
}

View file

@ -936,7 +936,7 @@ fn get_recursion_var(subs: &Subs, var: Variable) -> Option<Variable> {
}
}
fn union_sorted_tags_help<'a>(
pub fn union_sorted_tags_help<'a>(
arena: &'a Bump,
mut tags_vec: std::vec::Vec<(TagName, std::vec::Vec<Variable>)>,
opt_rec_var: Option<Variable>,