Oops, match semantics of each group/window (#967)

This commit is contained in:
JT
2022-02-06 21:26:01 -05:00
committed by GitHub
parent 8a373dd554
commit 84d3620d9b
4 changed files with 23 additions and 30 deletions

View File

@ -12,42 +12,36 @@ fn each_works_separately() {
assert_eq!(actual.out, "[11,12,13]");
}
// FIXME: jt: needs more work
#[ignore]
#[test]
fn each_group_works() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
echo [1 2 3 4 5 6] | each group 3 { $it } | to json
echo [1 2 3 4 5 6] | each group 3 { $it } | to json --raw
"#
));
assert_eq!(actual.out, "[[1,2,3],[4,5,6]]");
}
// FIXME: jt: needs more work
#[ignore]
#[test]
fn each_window() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
echo [1 2 3 4] | each window 3 { $it } | to json
echo [1 2 3 4] | each window 3 { $it } | to json --raw
"#
));
assert_eq!(actual.out, "[[1,2,3],[2,3,4]]");
}
// FIXME: jt: needs more work
#[ignore]
#[test]
fn each_window_stride() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
echo [1 2 3 4 5 6] | each window 3 -s 2 { echo $it } | to json
echo [1 2 3 4 5 6] | each window 3 -s 2 { echo $it } | to json --raw
"#
));