Fix operator precedences, in particular |>

Fixes #571.
This commit is contained in:
KtorZ
2023-06-06 17:12:31 +02:00
parent 5faa925aea
commit 0afc3aba13
4 changed files with 38 additions and 7 deletions

View File

@@ -799,3 +799,20 @@ fn test_fail() {
assert_fmt(src, src);
}
#[test]
fn pipes_and_expressions() {
let src = indoc! {r#"
test fmt() {
(x == y) && ((z |> length()) == x)
}
"#};
let expected = indoc! {r#"
test fmt() {
x == y && ( z |> length() ) == x
}
"#};
assert_fmt(src, expected);
}