diff --git a/compiler/parse/tests/snapshots/pass/nested_if.expr.result-ast b/compiler/parse/tests/snapshots/pass/nested_if.expr.result-ast new file mode 100644 index 0000000000..9a2e97e67c --- /dev/null +++ b/compiler/parse/tests/snapshots/pass/nested_if.expr.result-ast @@ -0,0 +1,50 @@ +If( + [ + ( + |L 0-0, C 3-5| Var { + module_name: "", + ident: "t1", + }, + |L 1-1, C 2-3| SpaceBefore( + SpaceAfter( + Num( + "1", + ), + [ + Newline, + ], + ), + [ + Newline, + ], + ), + ), + ( + |L 2-2, C 8-10| Var { + module_name: "", + ident: "t2", + }, + |L 3-3, C 2-3| SpaceBefore( + SpaceAfter( + Num( + "2", + ), + [ + Newline, + ], + ), + [ + Newline, + ], + ), + ), + ], + |L 5-5, C 2-3| SpaceBefore( + Num( + "3", + ), + [ + Newline, + ], + ), +) diff --git a/compiler/parse/tests/snapshots/pass/nested_if.expr.roc b/compiler/parse/tests/snapshots/pass/nested_if.expr.roc new file mode 100644 index 0000000000..4f8ee31829 --- /dev/null +++ b/compiler/parse/tests/snapshots/pass/nested_if.expr.roc @@ -0,0 +1,6 @@ +if t1 then + 1 +else if t2 then + 2 +else + 3 diff --git a/compiler/parse/tests/test_parse.rs b/compiler/parse/tests/test_parse.rs index 9524b40c47..b563bc3c58 100644 --- a/compiler/parse/tests/test_parse.rs +++ b/compiler/parse/tests/test_parse.rs @@ -164,6 +164,7 @@ mod test_parse { pass/negative_float.expr, pass/negative_int.expr, pass/nested_def_annotation.module, + pass/nested_if.expr, pass/nested_module.header, pass/newline_after_equals.expr, // Regression test for https://github.com/rtfeldman/roc/issues/51 pass/newline_after_mul.expr,