fix: panic in formatter when substracting u8 0 - 1
This commit is contained in:
@@ -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!(
|
||||
|
||||
@@ -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 )
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user