Proper precedence history in math (#1966)

This commit is contained in:
Jonathan Turner
2020-06-11 10:17:08 -07:00
committed by GitHub
parent a3e1a3f266
commit 982f067d0e
2 changed files with 15 additions and 4 deletions

View File

@ -84,6 +84,18 @@ fn division_of_ints2() {
assert_eq!(actual.out, "0.25");
}
#[test]
fn proper_precedence_history() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
= 2 / 2 / 2 + 1
"#
));
assert_eq!(actual.out, "1.5");
}
#[test]
fn parens_precedence() {
let actual = nu!(