Implement parser & formatter for Pair annotations.
This commit is contained in:
@@ -792,3 +792,13 @@ fn superfluous_parens_in_binop() {
|
||||
"#
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn format_pairs() {
|
||||
assert_format!(
|
||||
r#"
|
||||
pub fn foo(x: Pair<Int, Int>) {
|
||||
Pair(x.1st, x.2nd)
|
||||
}"#
|
||||
);
|
||||
}
|
||||
|
||||
7
crates/aiken-lang/src/tests/snapshots/format_pairs.snap
Normal file
7
crates/aiken-lang/src/tests/snapshots/format_pairs.snap
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
source: crates/aiken-lang/src/tests/format.rs
|
||||
description: "Code:\n\npub fn foo(x: Pair<Int, Int>) {\n Pair(x.1st, x.2nd)\n}"
|
||||
---
|
||||
pub fn foo(x: Pair<Int, Int>) {
|
||||
Pair(x.1st, x.2nd)
|
||||
}
|
||||
Reference in New Issue
Block a user