test: adjust formatter tests after latest tweaks
This commit is contained in:
@@ -138,6 +138,7 @@ fn test_format_when() {
|
||||
bar()
|
||||
|
||||
14
|
||||
|
||||
}
|
||||
False ->
|
||||
|
||||
@@ -155,8 +156,8 @@ fn test_format_when() {
|
||||
|
||||
14
|
||||
}
|
||||
False ->
|
||||
42
|
||||
|
||||
False -> 42
|
||||
}
|
||||
}
|
||||
"#};
|
||||
@@ -216,8 +217,7 @@ fn test_format_nested_when_if() {
|
||||
when xs is {
|
||||
[] ->
|
||||
[]
|
||||
[_x, ..rest] ->
|
||||
drop(rest, n - 1)
|
||||
[_x, ..rest] -> drop(rest, n - 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -246,18 +246,14 @@ fn test_format_nested_when() {
|
||||
let expected = indoc! {r#"
|
||||
fn foo() {
|
||||
when a is {
|
||||
None ->
|
||||
"foo"
|
||||
None -> "foo"
|
||||
Some(b) ->
|
||||
when b is {
|
||||
None ->
|
||||
"foo"
|
||||
None -> "foo"
|
||||
Some(c) ->
|
||||
when c is {
|
||||
None ->
|
||||
"foo"
|
||||
Some(_) ->
|
||||
"foo"
|
||||
None -> "foo"
|
||||
Some(_) -> "foo"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -416,10 +412,8 @@ fn test_nested_function_calls() {
|
||||
),
|
||||
),
|
||||
when output.datum is {
|
||||
InlineDatum(_) ->
|
||||
True
|
||||
_ ->
|
||||
error @"expected inline datum"
|
||||
InlineDatum(_) -> True
|
||||
_ -> error @"expected inline datum"
|
||||
},
|
||||
]
|
||||
|> list.and
|
||||
@@ -468,10 +462,8 @@ fn format_trace_todo_error() {
|
||||
|
||||
fn foo_3() {
|
||||
when x is {
|
||||
Foo ->
|
||||
True
|
||||
_ ->
|
||||
error
|
||||
Foo -> True
|
||||
_ -> error
|
||||
}
|
||||
}
|
||||
|
||||
@@ -594,24 +586,18 @@ fn test_newline_module_comments() {
|
||||
#[test]
|
||||
fn test_bytearray_literals() {
|
||||
let src = indoc! {r#"
|
||||
const foo_const_array =
|
||||
#[102, 111, 111]
|
||||
const foo_const_array = #[102, 111, 111]
|
||||
|
||||
const foo_const_hex =
|
||||
#"666f6f"
|
||||
const foo_const_hex = #"666f6f"
|
||||
|
||||
const foo_const_utf8 =
|
||||
"foo"
|
||||
const foo_const_utf8 = "foo"
|
||||
|
||||
fn foo() {
|
||||
let foo_const_array =
|
||||
#[102, 111, 111]
|
||||
let foo_const_array = #[102, 111, 111]
|
||||
|
||||
let foo_const_hex =
|
||||
#"666f6f"
|
||||
let foo_const_hex = #"666f6f"
|
||||
|
||||
let foo_const_utf8 =
|
||||
"foo"
|
||||
let foo_const_utf8 = "foo"
|
||||
}
|
||||
"#};
|
||||
|
||||
@@ -621,12 +607,10 @@ fn test_bytearray_literals() {
|
||||
#[test]
|
||||
fn test_string_literal() {
|
||||
let src = indoc! {r#"
|
||||
const foo_const: String =
|
||||
@"foo"
|
||||
const foo_const: String = @"foo"
|
||||
|
||||
fn foo() {
|
||||
let foo_var: String =
|
||||
@"foo"
|
||||
let foo_var: String = @"foo"
|
||||
}
|
||||
"#};
|
||||
|
||||
@@ -791,16 +775,11 @@ fn match_record() {
|
||||
let src = indoc! { r#"
|
||||
fn foo() {
|
||||
when bar is {
|
||||
Bar { a, b, c } ->
|
||||
Void
|
||||
Bar { a, .. } ->
|
||||
Void
|
||||
Bar { .. } ->
|
||||
Void
|
||||
Bar(a, b, c) ->
|
||||
Void
|
||||
Bar(..) ->
|
||||
Void
|
||||
Bar { a, b, c } -> Void
|
||||
Bar { a, .. } -> Void
|
||||
Bar { .. } -> Void
|
||||
Bar(a, b, c) -> Void
|
||||
Bar(..) -> Void
|
||||
}
|
||||
}
|
||||
"#};
|
||||
|
||||
Reference in New Issue
Block a user