Fix numeric comparison with nothing (#1508)

This commit is contained in:
Jonathan Turner
2020-03-21 11:02:49 +13:00
committed by GitHub
parent ab5e24a0e7
commit 918822ae0d
2 changed files with 16 additions and 0 deletions

View File

@ -10,6 +10,16 @@ fn filters_by_unit_size_comparison() {
assert_eq!(actual, "cargo_sample.toml");
}
#[test]
fn filters_with_nothing_comparison() {
let actual = nu!(
cwd: "tests/fixtures/formats",
r#"echo '[{"foo": 3}, {"foo": null}, {"foo": 4}]' | from-json | where foo > 1 | get foo | sum | echo $it"#
);
assert_eq!(actual, "7");
}
#[test]
fn binary_operator_comparisons() {
let actual = nu!(