From 4f91d2512a8952be06738d9797a084dc32c75734 Mon Sep 17 00:00:00 2001 From: "notryanb@gmail.com" Date: Wed, 16 Oct 2019 20:45:37 -0400 Subject: [PATCH] add a test to calculate average of bytes --- tests/filters_test.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/filters_test.rs b/tests/filters_test.rs index 7696b2f80b..0754f76d20 100644 --- a/tests/filters_test.rs +++ b/tests/filters_test.rs @@ -580,7 +580,7 @@ fn can_sum() { } #[test] -fn can_average() { +fn can_average_numbers() { let actual = nu!( cwd: "tests/fixtures/formats", h::pipeline( r#" @@ -594,6 +594,16 @@ fn can_average() { 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] fn can_filter_by_unit_size_comparison() { let actual = nu!(