mirror of
https://github.com/nushell/nushell
synced 2024-12-26 13:03:07 +00:00
43 lines
1.1 KiB
XML
43 lines
1.1 KiB
XML
// use nu_test_support::{nu, pipeline};
|
|
// use nu_test_support::playground::Playground;
|
|
// use nu_test_support::fs::Stub::FileWithContentToBeTrimmed;
|
|
|
|
// #[test]
|
|
// fn can_sum() {
|
|
// let actual = nu!(
|
|
// cwd: "tests/fixtures/formats", h::pipeline(
|
|
// r#"
|
|
// open sgml_description.json
|
|
// | get glossary.GlossDiv.GlossList.GlossEntry.Sections
|
|
// | sum
|
|
// | echo $it
|
|
// "#
|
|
// ));
|
|
|
|
// assert_eq!(actual, "203")
|
|
// }
|
|
|
|
// #[test]
|
|
// fn can_average_numbers() {
|
|
// let actual = nu!(
|
|
// cwd: "tests/fixtures/formats", h::pipeline(
|
|
// r#"
|
|
// open sgml_description.json
|
|
// | get glossary.GlossDiv.GlossList.GlossEntry.Sections
|
|
// | average
|
|
// | echo $it
|
|
// "#
|
|
// ));
|
|
|
|
// assert_eq!(actual, "101.5000000000000")
|
|
// }
|
|
|
|
// #[test]
|
|
// fn can_average_bytes() {
|
|
// let actual = nu!(
|
|
// cwd: "tests/fixtures/formats",
|
|
// "ls | sort-by name | skip 1 | first 2 | get size | average | echo $it"
|
|
// );
|
|
|
|
// assert_eq!(actual, "1600.000000000000");
|
|
// }
|