fix: comments in record patterns closes #946
This commit is contained in:
@@ -749,6 +749,24 @@ fn format_int_uint() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preserve_comment_in_record() {
|
||||
assert_format!(
|
||||
r#"
|
||||
fn foo() {
|
||||
let Output {
|
||||
// something
|
||||
address: own_address,
|
||||
// value: own_value,
|
||||
..
|
||||
} = own_output
|
||||
|
||||
own_address
|
||||
}
|
||||
"#
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fail_expr() {
|
||||
assert_format!(
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
source: crates/aiken-lang/src/tests/format.rs
|
||||
description: "Code:\n\nfn foo() {\n let Output {\n // something\n address: own_address,\n // value: own_value,\n ..\n } = own_output\n\n own_address\n}\n"
|
||||
---
|
||||
fn foo() {
|
||||
let Output {
|
||||
// something
|
||||
address: own_address,
|
||||
// value: own_value,
|
||||
..
|
||||
} = own_output
|
||||
|
||||
own_address
|
||||
}
|
||||
Reference in New Issue
Block a user