mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 08:11:12 +00:00
fix clippy unnecessary hashes
This commit is contained in:
parent
5d98783cf2
commit
1126f85b5a
21 changed files with 4158 additions and 4158 deletions
|
@ -124,11 +124,11 @@ fn bool_basic_equality() {
|
|||
fn bool_true() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
r"
|
||||
Bool.true
|
||||
"#
|
||||
"
|
||||
),
|
||||
r#"Bool.true : Bool"#,
|
||||
r"Bool.true : Bool",
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -136,11 +136,11 @@ fn bool_true() {
|
|||
fn bool_false() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
r"
|
||||
Bool.false
|
||||
"#
|
||||
"
|
||||
),
|
||||
r#"Bool.false : Bool"#,
|
||||
r"Bool.false : Bool",
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -315,24 +315,24 @@ fn nested_string_list() {
|
|||
#[test]
|
||||
fn nested_num_list() {
|
||||
expect_success(
|
||||
r#"[[[4, 3, 2], [1, 0]], [[]], []]"#,
|
||||
r#"[[[4, 3, 2], [1, 0]], [[]], []] : List (List (List (Num *)))"#,
|
||||
r"[[[4, 3, 2], [1, 0]], [[]], []]",
|
||||
r"[[[4, 3, 2], [1, 0]], [[]], []] : List (List (List (Num *)))",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn nested_int_list() {
|
||||
expect_success(
|
||||
r#"[[[4, 3, 2], [1, 0x0]], [[]], []]"#,
|
||||
r#"[[[4, 3, 2], [1, 0]], [[]], []] : List (List (List (Int *)))"#,
|
||||
r"[[[4, 3, 2], [1, 0x0]], [[]], []]",
|
||||
r"[[[4, 3, 2], [1, 0]], [[]], []] : List (List (List (Int *)))",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn nested_float_list() {
|
||||
expect_success(
|
||||
r#"[[[4, 3, 2], [1, 0.0]], [[]], []]"#,
|
||||
r#"[[[4, 3, 2], [1, 0]], [[]], []] : List (List (List (Frac *)))"#,
|
||||
r"[[[4, 3, 2], [1, 0.0]], [[]], []]",
|
||||
r"[[[4, 3, 2], [1, 0]], [[]], []] : List (List (List (Frac *)))",
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -641,7 +641,7 @@ fn too_few_args() {
|
|||
expect_failure(
|
||||
"Num.add 2",
|
||||
indoc!(
|
||||
r#"
|
||||
r"
|
||||
── TOO FEW ARGS ────────────────────────────────────────────────────────────────
|
||||
|
||||
The add function expects 2 arguments, but it got only 1:
|
||||
|
@ -651,7 +651,7 @@ fn too_few_args() {
|
|||
|
||||
Roc does not allow functions to be partially applied. Use a closure to
|
||||
make partial application explicit.
|
||||
"#
|
||||
"
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -970,7 +970,7 @@ fn large_nullable_wrapped_tag_union() {
|
|||
fn issue_2300() {
|
||||
expect_success(
|
||||
r#"\Email str -> str == """#,
|
||||
r#"<function> : [Email Str] -> Bool"#,
|
||||
r"<function> : [Email Str] -> Bool",
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -978,8 +978,8 @@ fn issue_2300() {
|
|||
#[test]
|
||||
fn function_in_list() {
|
||||
expect_success(
|
||||
r#"[\x -> x + 1, \s -> s * 2]"#,
|
||||
r#"[<function>, <function>] : List (Num a -> Num a)"#,
|
||||
r"[\x -> x + 1, \s -> s * 2]",
|
||||
r"[<function>, <function>] : List (Num a -> Num a)",
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -987,8 +987,8 @@ fn function_in_list() {
|
|||
#[test]
|
||||
fn function_in_record() {
|
||||
expect_success(
|
||||
r#"{ n: 1, adder: \x -> x + 1 }"#,
|
||||
r#"{ adder: <function>, n: 1 } : { adder : Num a -> Num a, n : Num * }"#,
|
||||
r"{ n: 1, adder: \x -> x + 1 }",
|
||||
r"{ adder: <function>, n: 1 } : { adder : Num a -> Num a, n : Num * }",
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -996,8 +996,8 @@ fn function_in_record() {
|
|||
#[test]
|
||||
fn function_in_unwrapped_record() {
|
||||
expect_success(
|
||||
r#"{ adder: \x -> x + 1 }"#,
|
||||
r#"{ adder: <function> } : { adder : Num a -> Num a }"#,
|
||||
r"{ adder: \x -> x + 1 }",
|
||||
r"{ adder: <function> } : { adder : Num a -> Num a }",
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -1005,16 +1005,16 @@ fn function_in_unwrapped_record() {
|
|||
#[test]
|
||||
fn function_in_tag() {
|
||||
expect_success(
|
||||
r#"Adder (\x -> x + 1)"#,
|
||||
r#"Adder <function> : [Adder (Num a -> Num a)]"#,
|
||||
r"Adder (\x -> x + 1)",
|
||||
r"Adder <function> : [Adder (Num a -> Num a)]",
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn newtype_of_record_of_tag_of_record_of_tag() {
|
||||
expect_success(
|
||||
r#"A {b: C {d: 1}}"#,
|
||||
r#"A { b: C { d: 1 } } : [A { b : [C { d : Num * }] }]"#,
|
||||
r"A {b: C {d: 1}}",
|
||||
r"A { b: C { d: 1 } } : [A { b : [C { d : Num * }] }]",
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -1022,11 +1022,11 @@ fn newtype_of_record_of_tag_of_record_of_tag() {
|
|||
fn print_u8s() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
r"
|
||||
x : U8
|
||||
x = 129
|
||||
x
|
||||
"#
|
||||
"
|
||||
),
|
||||
"129 : U8",
|
||||
)
|
||||
|
@ -1062,17 +1062,17 @@ fn parse_problem() {
|
|||
fn issue_2343_complete_mono_with_shadowed_vars() {
|
||||
expect_failure(
|
||||
indoc!(
|
||||
r#"
|
||||
r"
|
||||
b = False
|
||||
f = \b ->
|
||||
when b is
|
||||
True -> 5
|
||||
False -> 15
|
||||
f b
|
||||
"#
|
||||
"
|
||||
),
|
||||
indoc!(
|
||||
r#"
|
||||
r"
|
||||
── DUPLICATE NAME ──────────────────────────────────────────────────────────────
|
||||
|
||||
The b name is first defined here:
|
||||
|
@ -1087,7 +1087,7 @@ fn issue_2343_complete_mono_with_shadowed_vars() {
|
|||
|
||||
Since these variables have the same name, it's easy to use the wrong
|
||||
one by accident. Give one of them a new name.
|
||||
"#
|
||||
"
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -1126,12 +1126,12 @@ fn tag_with_type_behind_alias() {
|
|||
fn issue_2588_record_with_function_and_nonfunction() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
r"
|
||||
x = 1
|
||||
f = \n -> n * 2
|
||||
{ y: f x, f }"#
|
||||
{ y: f x, f }"
|
||||
),
|
||||
r#"{ f: <function>, y: 2 } : { f : Num a -> Num a, y : Num * }"#,
|
||||
r"{ f: <function>, y: 2 } : { f : Num a -> Num a, y : Num * }",
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -1139,10 +1139,10 @@ fn issue_2588_record_with_function_and_nonfunction() {
|
|||
fn opaque_apply() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
r"
|
||||
Age := U32
|
||||
|
||||
@Age 23"#
|
||||
@Age 23"
|
||||
),
|
||||
"@Age 23 : Age",
|
||||
)
|
||||
|
@ -1165,14 +1165,14 @@ fn opaque_apply_polymorphic() {
|
|||
fn opaque_pattern_and_call() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
r"
|
||||
F t u := [Package t u]
|
||||
|
||||
f = \@F (Package A {}) -> @F (Package {} A)
|
||||
|
||||
f (@F (Package A {}))"#
|
||||
f (@F (Package A {}))"
|
||||
),
|
||||
r#"@F (Package {} A) : F {} [A]"#,
|
||||
r"@F (Package {} A) : F {} [A]",
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -1180,10 +1180,10 @@ fn opaque_pattern_and_call() {
|
|||
fn dec_in_repl() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
r"
|
||||
x: Dec
|
||||
x=1.23
|
||||
x"#
|
||||
x"
|
||||
),
|
||||
"1.23 : Dec",
|
||||
)
|
||||
|
@ -1193,12 +1193,12 @@ fn dec_in_repl() {
|
|||
fn print_i8_issue_2710() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
r"
|
||||
a : I8
|
||||
a = -1
|
||||
a"#
|
||||
a"
|
||||
),
|
||||
r#"-1 : I8"#,
|
||||
r"-1 : I8",
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -1243,11 +1243,11 @@ fn issue_2582_specialize_result_value() {
|
|||
fn issue_2818() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
r"
|
||||
f : {} -> List Str
|
||||
f = \_ ->
|
||||
x = []
|
||||
x"#
|
||||
x"
|
||||
),
|
||||
r"<function> : {} -> List Str",
|
||||
)
|
||||
|
@ -1257,7 +1257,7 @@ fn issue_2818() {
|
|||
fn issue_2810_recursive_layout_inside_nonrecursive() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
r"
|
||||
Command : [Command Tool]
|
||||
|
||||
Job : [Job Command]
|
||||
|
@ -1266,7 +1266,7 @@ fn issue_2810_recursive_layout_inside_nonrecursive() {
|
|||
|
||||
a : Job
|
||||
a = Job (Command (FromJob (Job (Command SystemTool))))
|
||||
a"#
|
||||
a"
|
||||
),
|
||||
"Job (Command (FromJob (Job (Command SystemTool)))) : Job",
|
||||
)
|
||||
|
@ -1276,12 +1276,12 @@ fn issue_2810_recursive_layout_inside_nonrecursive() {
|
|||
fn render_nullable_unwrapped_passing_through_alias() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
r"
|
||||
Deep : [L DeepList]
|
||||
DeepList : [Nil, Cons Deep]
|
||||
v : DeepList
|
||||
v = (Cons (L (Cons (L (Cons (L Nil))))))
|
||||
v"#
|
||||
v"
|
||||
),
|
||||
"Cons (L (Cons (L (Cons (L Nil))))) : DeepList",
|
||||
)
|
||||
|
@ -1291,9 +1291,9 @@ fn render_nullable_unwrapped_passing_through_alias() {
|
|||
fn opaque_wrap_function() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
r"
|
||||
A a := a
|
||||
List.map [1u8, 2u8, 3u8] @A"#
|
||||
List.map [1u8, 2u8, 3u8] @A"
|
||||
),
|
||||
"[@A 1, @A 2, @A 3] : List (A U8)",
|
||||
);
|
||||
|
@ -1305,10 +1305,10 @@ fn opaque_wrap_function() {
|
|||
fn dict_get_single() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
Dict.single 0 {a: 1, c: 2} |> Dict.get 0"#
|
||||
r"
|
||||
Dict.single 0 {a: 1, c: 2} |> Dict.get 0"
|
||||
),
|
||||
r#"Ok { a: 1, c: 2 } : Result { a : Num *, c : Num * } [KeyNotFound]"#,
|
||||
r"Ok { a: 1, c: 2 } : Result { a : Num *, c : Num * } [KeyNotFound]",
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -1319,7 +1319,7 @@ fn record_of_poly_function() {
|
|||
r#"
|
||||
{ a: \_ -> "a" }"#
|
||||
),
|
||||
r#"{ a: <function> } : { a : * -> Str }"#,
|
||||
r"{ a: <function> } : { a : * -> Str }",
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1338,18 +1338,18 @@ fn record_of_poly_function_and_string() {
|
|||
fn newtype_by_void_is_wrapped() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
Result.try (Err 42) (\x -> Err (x+1))"#
|
||||
r"
|
||||
Result.try (Err 42) (\x -> Err (x+1))"
|
||||
),
|
||||
r#"Err 42 : Result b (Num *)"#,
|
||||
r"Err 42 : Result b (Num *)",
|
||||
);
|
||||
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
Result.try (Ok 42) (\x -> Ok (x+1))"#
|
||||
r"
|
||||
Result.try (Ok 42) (\x -> Ok (x+1))"
|
||||
),
|
||||
r#"Ok 43 : Result (Num *) err"#,
|
||||
r"Ok 43 : Result (Num *) err",
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1357,11 +1357,11 @@ fn newtype_by_void_is_wrapped() {
|
|||
fn enum_tag_union_in_list() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
r"
|
||||
[E, F, G, H]
|
||||
"#
|
||||
"
|
||||
),
|
||||
r#"[E, F, G, H] : List [E, F, G, H]"#,
|
||||
r"[E, F, G, H] : List [E, F, G, H]",
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1373,7 +1373,7 @@ fn str_to_dec() {
|
|||
Str.toDec "1234.1234"
|
||||
"#
|
||||
),
|
||||
r#"Ok 1234.1234 : Result Dec [InvalidNumStr]"#,
|
||||
r"Ok 1234.1234 : Result Dec [InvalidNumStr]",
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1405,7 +1405,7 @@ fn nested_tuple() {
|
|||
fn ordered_tag_union_memory_layout() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
r"
|
||||
Loc : { line: U32, column: U32 }
|
||||
|
||||
Node : [ A Loc, Height U8 Loc ]
|
||||
|
@ -1413,9 +1413,9 @@ fn ordered_tag_union_memory_layout() {
|
|||
x : Node
|
||||
x = Height 1 { line: 2, column: 3 }
|
||||
x
|
||||
"#
|
||||
"
|
||||
),
|
||||
r#"Height 1 { column: 3, line: 2 } : Node"#,
|
||||
r"Height 1 { column: 3, line: 2 } : Node",
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue