fix(nu-command/tests): further remove unnecessary pipeline() and cwd() (#8793)

# Description

This PR further fixes tests as part of #8670 

# User-Facing Changes

None

# Tests + Formatting

None

# After Submitting

None

---------

Signed-off-by: Harshal Chaudhari <harshal.chaudhary@gmail.com>
Co-authored-by: Reilly Wood <reilly.wood@icloud.com>
This commit is contained in:
Harshal Chaudhari
2023-04-07 22:09:55 +01:00
committed by GitHub
parent 1c5846e1fb
commit 35e8420780
16 changed files with 140 additions and 335 deletions

View File

@ -14,12 +14,12 @@ fn gets_all_rows_by_every_zero() {
let actual = nu!(
cwd: dirs.test(), pipeline(
r#"
"
ls
| get name
| every 0
| to json --raw
"#
"
));
assert_eq!(
@ -41,12 +41,12 @@ fn gets_no_rows_by_every_skip_zero() {
let actual = nu!(
cwd: dirs.test(), pipeline(
r#"
"
ls
| get name
| every 0 --skip
| to json --raw
"#
"
));
assert_eq!(actual.out, "[]");
@ -65,12 +65,12 @@ fn gets_all_rows_by_every_one() {
let actual = nu!(
cwd: dirs.test(), pipeline(
r#"
"
ls
| get name
| every 1
| to json --raw
"#
"
));
assert_eq!(
@ -92,12 +92,12 @@ fn gets_no_rows_by_every_skip_one() {
let actual = nu!(
cwd: dirs.test(), pipeline(
r#"
"
ls
| get name
| every 1 --skip
| to json --raw
"#
"
));
assert_eq!(actual.out, "[]");
@ -116,19 +116,14 @@ fn gets_first_row_by_every_too_much() {
let actual = nu!(
cwd: dirs.test(), pipeline(
r#"
"
ls
| get name
| every 999
"#
"
));
let expected = nu!(
cwd: dirs.test(), pipeline(
r#"
echo [ amigos.txt ]
"#
));
let expected = nu!( cwd: dirs.test(), "echo [ amigos.txt ]");
assert_eq!(actual.out, expected.out);
})
@ -146,12 +141,12 @@ fn gets_all_rows_except_first_by_every_skip_too_much() {
let actual = nu!(
cwd: dirs.test(), pipeline(
r#"
"
ls
| get name
| every 999 --skip
| to json --raw
"#
"
));
assert_eq!(actual.out, r#"["arepas.clu","los.txt","tres.txt"]"#);
@ -171,12 +166,12 @@ fn gets_every_third_row() {
let actual = nu!(
cwd: dirs.test(), pipeline(
r#"
"
ls
| get name
| every 3
| to json --raw
"#
"
));
assert_eq!(actual.out, r#"["amigos.txt","quatro.txt"]"#);
@ -196,12 +191,12 @@ fn skips_every_third_row() {
let actual = nu!(
cwd: dirs.test(), pipeline(
r#"
"
ls
| get name
| every 3 --skip
| to json --raw
"#
"
));
assert_eq!(actual.out, r#"["arepas.clu","los.txt","tres.txt"]"#);