Move 'keep' to 'take' (#5123)

This commit is contained in:
JT
2022-04-08 08:49:28 +12:00
committed by GitHub
parent e86c1b118e
commit 4f974efeba
12 changed files with 48 additions and 48 deletions

View File

@ -27,7 +27,6 @@ mod histogram;
mod insert;
mod into_filesize;
mod into_int;
mod keep;
mod last;
mod length;
mod lines;
@ -60,6 +59,7 @@ mod split_by;
mod split_column;
mod split_row;
mod str_;
mod take;
mod touch;
mod uniq;
mod update;

View File

@ -4,7 +4,7 @@ use nu_test_support::{nu, pipeline};
#[test]
fn rows() {
Playground::setup("keep_test_1", |dirs, sandbox| {
Playground::setup("take_test_1", |dirs, sandbox| {
sandbox.with_files(vec![FileWithContentToBeTrimmed(
"caballeros.csv",
r#"
@ -20,7 +20,7 @@ fn rows() {
cwd: dirs.test(), pipeline(
r#"
open caballeros.csv
| keep 3
| take 3
| get lucky_code
| math sum
"#

View File

@ -4,7 +4,7 @@ use nu_test_support::{nu, pipeline};
#[test]
fn condition_is_met() {
Playground::setup("keep_until_test_1", |dirs, sandbox| {
Playground::setup("take_until_test_1", |dirs, sandbox| {
sandbox.with_files(vec![FileWithContentToBeTrimmed(
"caballeros.txt",
r#"
@ -39,7 +39,7 @@ fn condition_is_met() {
| str collect (char nl)
| from csv
| skip while "Chicken Collection" != "Blue Chickens"
| keep until "Chicken Collection" == "Red Chickens"
| take until "Chicken Collection" == "Red Chickens"
| skip 1
| into int "31/04/2020"
| get "31/04/2020"

View File

@ -4,7 +4,7 @@ use nu_test_support::{nu, pipeline};
#[test]
fn condition_is_met() {
Playground::setup("keep_while_test_1", |dirs, sandbox| {
Playground::setup("take_while_test_1", |dirs, sandbox| {
sandbox.with_files(vec![FileWithContentToBeTrimmed(
"caballeros.txt",
r#"
@ -39,7 +39,7 @@ fn condition_is_met() {
| str collect (char nl)
| from csv
| skip 1
| keep while "Chicken Collection" != "Blue Chickens"
| take while "Chicken Collection" != "Blue Chickens"
| into int "31/04/2020"
| get "31/04/2020"
| math sum