mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 20:28:02 +00:00
Add a few tests
This commit is contained in:
parent
28a75611fc
commit
4e66910ef8
1 changed files with 65 additions and 0 deletions
|
@ -1776,6 +1776,71 @@ mod test_fmt {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lambda_returns_record_new_syntax() {
|
||||
expr_formats_same(indoc!(
|
||||
r"
|
||||
to_record = |_| {
|
||||
x: 1,
|
||||
y: 2,
|
||||
z: 3,
|
||||
}
|
||||
|
||||
to_record
|
||||
"
|
||||
));
|
||||
|
||||
expr_formats_same(indoc!(
|
||||
r"
|
||||
func = |_|
|
||||
{ x: 1, y: 2, z: 3 }
|
||||
|
||||
func
|
||||
"
|
||||
));
|
||||
|
||||
expr_formats_same(indoc!(
|
||||
r"
|
||||
to_record = |_|
|
||||
val = 0
|
||||
|
||||
{
|
||||
x: 1,
|
||||
y: 2,
|
||||
z: 3,
|
||||
}
|
||||
|
||||
to_record
|
||||
"
|
||||
));
|
||||
|
||||
expr_formats_to(
|
||||
indoc!(
|
||||
r"
|
||||
to_record = |_|
|
||||
{
|
||||
x: 1,
|
||||
y: 2,
|
||||
z: 3,
|
||||
}
|
||||
|
||||
to_record
|
||||
"
|
||||
),
|
||||
indoc!(
|
||||
r"
|
||||
to_record = |_| {
|
||||
x: 1,
|
||||
y: 2,
|
||||
z: 3,
|
||||
}
|
||||
|
||||
to_record
|
||||
"
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lambda_returns_list() {
|
||||
expr_formats_same(indoc!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue