From 139f6ae82cb9207c7632cc77381e39f589d060d2 Mon Sep 17 00:00:00 2001 From: snobee <86692451+snobee@users.noreply.github.com> Date: Fri, 6 Sep 2024 16:28:14 -0700 Subject: [PATCH] update tests for new Expr::If struct --- ...fixed__suffixed_tests__deps_final_expr.snap | 9 +++++---- ...t_suffixed__suffixed_tests__if_complex.snap | 18 ++++++++++-------- ...st_suffixed__suffixed_tests__if_simple.snap | 18 ++++++++++-------- .../pass/extra_newline.expr.result-ast | 9 +++++---- .../snapshots/pass/nested_if.expr.result-ast | 9 +++++---- .../snapshots/pass/plus_if.expr.result-ast | 9 +++++---- .../pass/record_with_if.expr.result-ast | 9 +++++---- 7 files changed, 45 insertions(+), 36 deletions(-) diff --git a/crates/compiler/can/tests/snapshots/test_suffixed__suffixed_tests__deps_final_expr.snap b/crates/compiler/can/tests/snapshots/test_suffixed__suffixed_tests__deps_final_expr.snap index bafdfd47ec..7ffe206521 100644 --- a/crates/compiler/can/tests/snapshots/test_suffixed__suffixed_tests__deps_final_expr.snap +++ b/crates/compiler/can/tests/snapshots/test_suffixed__suffixed_tests__deps_final_expr.snap @@ -63,8 +63,8 @@ Defs { ), ], }, - @66-130 If( - [ + @66-130 If { + if_thens: [ ( @69-70 Var { module_name: "", @@ -76,11 +76,12 @@ Defs { }, ), ], - @128-130 Var { + final_else: @128-130 Var { module_name: "", ident: "c", }, - ), + indented_else: false, + }, ), guard: None, }, diff --git a/crates/compiler/can/tests/snapshots/test_suffixed__suffixed_tests__if_complex.snap b/crates/compiler/can/tests/snapshots/test_suffixed__suffixed_tests__if_complex.snap index 4d62981e3d..9368bdb34b 100644 --- a/crates/compiler/can/tests/snapshots/test_suffixed__suffixed_tests__if_complex.snap +++ b/crates/compiler/can/tests/snapshots/test_suffixed__suffixed_tests__if_complex.snap @@ -136,8 +136,8 @@ Defs { ident: "#!1_arg", }, ], - @109-298 If( - [ + @109-298 If { + if_thens: [ ( @112-122 Apply( @112-113 Var { @@ -244,7 +244,7 @@ Defs { ), ), ], - Apply( + final_else: Apply( Var { module_name: "Task", ident: "await", @@ -269,8 +269,8 @@ Defs { ident: "#!3_arg", }, ], - @109-298 If( - [ + @109-298 If { + if_thens: [ ( @187-209 ParensAround( Var { @@ -366,7 +366,7 @@ Defs { ), ), ], - @283-298 Apply( + final_else: @283-298 Apply( @283-298 Var { module_name: "", ident: "line", @@ -380,12 +380,14 @@ Defs { ], Space, ), - ), + indented_else: false, + }, ), ], BangSuffix, ), - ), + indented_else: false, + }, ), ], BangSuffix, diff --git a/crates/compiler/can/tests/snapshots/test_suffixed__suffixed_tests__if_simple.snap b/crates/compiler/can/tests/snapshots/test_suffixed__suffixed_tests__if_simple.snap index cdf56fb5bb..0296ed9f3f 100644 --- a/crates/compiler/can/tests/snapshots/test_suffixed__suffixed_tests__if_simple.snap +++ b/crates/compiler/can/tests/snapshots/test_suffixed__suffixed_tests__if_simple.snap @@ -101,8 +101,8 @@ Defs { ident: "#!0_arg", }, ], - @76-189 If( - [ + @76-189 If { + if_thens: [ ( @79-87 Var { module_name: "", @@ -124,7 +124,7 @@ Defs { ), ), ], - @125-132 Apply( + final_else: @125-132 Apply( @125-132 Var { module_name: "Task", ident: "await", @@ -140,8 +140,8 @@ Defs { ident: "#!1_arg", }, ], - @76-189 If( - [ + @76-189 If { + if_thens: [ ( @125-132 Var { module_name: "", @@ -163,7 +163,7 @@ Defs { ), ), ], - @178-189 Apply( + final_else: @178-189 Apply( @178-182 Var { module_name: "", ident: "line", @@ -177,12 +177,14 @@ Defs { ], Space, ), - ), + indented_else: false, + }, ), ], BangSuffix, ), - ), + indented_else: false, + }, ), ], BangSuffix, diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/extra_newline.expr.result-ast b/crates/compiler/test_syntax/tests/snapshots/pass/extra_newline.expr.result-ast index b9aa239ccb..dda7a106ff 100644 --- a/crates/compiler/test_syntax/tests/snapshots/pass/extra_newline.expr.result-ast +++ b/crates/compiler/test_syntax/tests/snapshots/pass/extra_newline.expr.result-ast @@ -1,6 +1,6 @@ SpaceAfter( - If( - [ + If { + if_thens: [ ( @3-6 Var { module_name: "", @@ -60,7 +60,7 @@ SpaceAfter( ), ), ], - @49-50 SpaceBefore( + final_else: @49-50 SpaceBefore( Var { module_name: "", ident: "c", @@ -71,7 +71,8 @@ SpaceAfter( ), ], ), - ), + indented_else: false, + }, [ LineComment( " 4", diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/nested_if.expr.result-ast b/crates/compiler/test_syntax/tests/snapshots/pass/nested_if.expr.result-ast index a393541c92..ddbb758b5d 100644 --- a/crates/compiler/test_syntax/tests/snapshots/pass/nested_if.expr.result-ast +++ b/crates/compiler/test_syntax/tests/snapshots/pass/nested_if.expr.result-ast @@ -1,6 +1,6 @@ SpaceAfter( - If( - [ + If { + if_thens: [ ( @3-5 Var { module_name: "", @@ -40,7 +40,7 @@ SpaceAfter( ), ), ], - @42-43 SpaceBefore( + final_else: @42-43 SpaceBefore( Num( "3", ), @@ -48,7 +48,8 @@ SpaceAfter( Newline, ], ), - ), + indented_else: false, + }, [ Newline, ], diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/plus_if.expr.result-ast b/crates/compiler/test_syntax/tests/snapshots/pass/plus_if.expr.result-ast index 9157138188..a459e1f941 100644 --- a/crates/compiler/test_syntax/tests/snapshots/pass/plus_if.expr.result-ast +++ b/crates/compiler/test_syntax/tests/snapshots/pass/plus_if.expr.result-ast @@ -8,8 +8,8 @@ SpaceAfter( @2-3 Star, ), ], - @4-30 If( - [ + @4-30 If { + if_thens: [ ( @7-16 Var { module_name: "Bool", @@ -20,10 +20,11 @@ SpaceAfter( ), ), ], - @29-30 Num( + final_else: @29-30 Num( "1", ), - ), + indented_else: false, + }, ), [ Newline, diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/record_with_if.expr.result-ast b/crates/compiler/test_syntax/tests/snapshots/pass/record_with_if.expr.result-ast index 43a85f4464..3fb9809308 100644 --- a/crates/compiler/test_syntax/tests/snapshots/pass/record_with_if.expr.result-ast +++ b/crates/compiler/test_syntax/tests/snapshots/pass/record_with_if.expr.result-ast @@ -3,8 +3,8 @@ Record( @1-31 RequiredValue( @1-2 "x", [], - @5-31 If( - [ + @5-31 If { + if_thens: [ ( @8-17 Var { module_name: "Bool", @@ -15,10 +15,11 @@ Record( ), ), ], - @30-31 Num( + final_else: @30-31 Num( "2", ), - ), + indented_else: false, + }, ), @33-37 RequiredValue( @33-34 "y",