mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
add tests
This commit is contained in:
parent
7fe052322c
commit
4e4d9b0d4c
1 changed files with 72 additions and 0 deletions
|
@ -6230,6 +6230,32 @@ mod test_fmt {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preserve_annotated_body() {
|
||||
expr_formats_same(
|
||||
indoc!(
|
||||
r"
|
||||
x : i32
|
||||
x = 1
|
||||
x
|
||||
"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preserve_annotated_body_comment() {
|
||||
expr_formats_same(
|
||||
indoc!(
|
||||
r"
|
||||
x : i32 # comment
|
||||
x = 1
|
||||
x
|
||||
"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preserve_annotated_body_comments() {
|
||||
expr_formats_same(
|
||||
|
@ -6245,6 +6271,52 @@ mod test_fmt {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preserve_annotated_body_comments_with_newlines() {
|
||||
expr_formats_same(
|
||||
indoc!(
|
||||
r"
|
||||
x : i32
|
||||
|
||||
# comment
|
||||
|
||||
# comment 2
|
||||
|
||||
x = 1
|
||||
x
|
||||
"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preserve_annotated_body_blank_comment() {
|
||||
expr_formats_same(
|
||||
indoc!(
|
||||
r"
|
||||
x : i32
|
||||
#
|
||||
x = 1
|
||||
x
|
||||
"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preserve_annotated_body_with_newlines() {
|
||||
expr_formats_same(
|
||||
indoc!(
|
||||
r"
|
||||
x : i32
|
||||
|
||||
x = 1
|
||||
x
|
||||
"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// this is a parse error atm
|
||||
// #[test]
|
||||
// fn multiline_apply() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue