mirror of
https://github.com/nushell/nushell.git
synced 2025-05-10 04:54:28 +02:00
add a test to calculate average of bytes
This commit is contained in:
parent
2f5eeab567
commit
4f91d2512a
@ -580,7 +580,7 @@ fn can_sum() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_average() {
|
fn can_average_numbers() {
|
||||||
let actual = nu!(
|
let actual = nu!(
|
||||||
cwd: "tests/fixtures/formats", h::pipeline(
|
cwd: "tests/fixtures/formats", h::pipeline(
|
||||||
r#"
|
r#"
|
||||||
@ -594,6 +594,16 @@ fn can_average() {
|
|||||||
assert_eq!(actual, "101.5000000000000")
|
assert_eq!(actual, "101.5000000000000")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn can_average_bytes() {
|
||||||
|
let actual = nu!(
|
||||||
|
cwd: "tests/fixtures/formats",
|
||||||
|
"ls | get size | average | echo $it"
|
||||||
|
);
|
||||||
|
|
||||||
|
assert_eq!(actual, "2282.727272727273");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_filter_by_unit_size_comparison() {
|
fn can_filter_by_unit_size_comparison() {
|
||||||
let actual = nu!(
|
let actual = nu!(
|
||||||
|
Loading…
Reference in New Issue
Block a user