fix: comments in record patterns closes #946

This commit is contained in:
rvcas
2024-05-22 12:26:32 -04:00
parent c16bd06e97
commit 7f38b55c1c
25 changed files with 172 additions and 100 deletions

View File

@@ -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!(

View File

@@ -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
}