a few more tests (#941)

This commit is contained in:
Darren Schroeder
2022-02-04 15:42:18 -06:00
committed by GitHub
parent f29dbeddd7
commit b26acf97bd
2 changed files with 7 additions and 15 deletions

View File

@ -1,13 +1,11 @@
use nu_test_support::{nu, pipeline};
// FIXME: jt: needs more work
#[ignore]
#[test]
fn each_works_separately() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
echo [1 2 3] | each { echo $it 10 | math sum } | to json
echo [1 2 3] | each { echo $it 10 | math sum } | to json -r
"#
));
@ -56,18 +54,16 @@ fn each_window_stride() {
assert_eq!(actual.out, "[[1,2,3],[3,4,5]]");
}
// FIXME: jt: needs more work
#[ignore]
#[test]
fn each_no_args_in_block() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
echo [[foo bar]; [a b] [c d] [e f]] | each { to json } | nth 1 | str collect
echo [[foo bar]; [a b] [c d] [e f]] | each {|i| $i | to json -r } | nth 1
"#
));
assert_eq!(actual.out, r#"{"foo":"c","bar":"d"}"#);
assert_eq!(actual.out, r#"{"foo": "c","bar": "d"}"#);
}
#[test]