fix: panic in formatter when substracting u8 0 - 1

This commit is contained in:
rvcas
2023-11-18 17:09:01 -05:00
committed by Lucas
parent 6869f73033
commit 7680d33663
6 changed files with 68 additions and 3 deletions

View File

@@ -87,6 +87,39 @@ fn format_grouped_expression() {
);
}
#[test]
fn format_grouped_expression_2() {
assert_format!(
r#"
fn foo() {
( y == x ) |> f
}
"#
);
}
#[test]
fn format_grouped_expression_3() {
assert_format!(
r#"
fn foo() {
{ x |> f } == y
}
"#
);
}
#[test]
fn format_grouped_expression_4() {
assert_format!(
r#"
fn foo() {
x |> { f == y }
}
"#
);
}
#[test]
fn format_validator() {
assert_format!(

View File

@@ -0,0 +1,8 @@
---
source: crates/aiken-lang/src/tests/format.rs
description: "Code:\n\nfn foo() {\n y == { x |> f }\n}\n"
---
fn foo() {
y == ( x |> f )
}

View File

@@ -0,0 +1,8 @@
---
source: crates/aiken-lang/src/tests/format.rs
description: "Code:\n\nfn foo() {\n ( y == x ) |> f\n}\n"
---
fn foo() {
( y == x ) |> f
}

View File

@@ -0,0 +1,8 @@
---
source: crates/aiken-lang/src/tests/format.rs
description: "Code:\n\nfn foo() {\n { x |> f } == y\n}\n"
---
fn foo() {
( x |> f ) == y
}

View File

@@ -0,0 +1,8 @@
---
source: crates/aiken-lang/src/tests/format.rs
description: "Code:\n\nfn foo() {\n x |> { f == y }\n}\n"
---
fn foo() {
x |> f == y
}