mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 06:30:08 +02:00
Move 'keep' to 'take' (#5123)
This commit is contained in:
@ -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;
|
||||
|
@ -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
|
||||
"#
|
@ -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"
|
@ -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
|
Reference in New Issue
Block a user