mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
Fix operator precedence parser (#4947)
This commit is contained in:
@ -67,6 +67,30 @@ fn precedence_of_operators2() {
|
||||
assert_eq!(actual.out, "6");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn precedence_of_operators3() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
5 - 5 * 10 + 5
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "-40");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn precedence_of_operators4() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
5 - (5 * 10) + 5
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "-40");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn division_of_ints() {
|
||||
let actual = nu!(
|
||||
|
Reference in New Issue
Block a user