fix all gen and cli tests

This commit is contained in:
Folkert 2021-02-02 22:06:11 +01:00
parent e643d1ea3c
commit f6aa77e6a8
4 changed files with 37 additions and 7 deletions

View file

@ -2819,6 +2819,31 @@ mod test_parse {
assert!(actual.is_ok());
}
#[test]
fn outdenting_newline_after_else() {
use roc_parse::ast::Def::*;
let arena = Bump::new();
// highlights a problem with the else branch demanding a newline after its expression
let src = indoc!(
r#"
main =
v = \y -> if x then y else z
1
"#
);
let actual = module_defs()
.parse(&arena, State::new(src.as_bytes(), Attempting::Module))
.map(|tuple| tuple.1);
dbg!(&actual);
assert!(actual.is_ok());
}
#[test]
fn newline_after_equals() {
// Regression test for https://github.com/rtfeldman/roc/issues/51