diff --git a/crates/nu-cli/src/commands/skip_until.rs b/crates/nu-cli/src/commands/skip_until.rs index 7cbcbb9f39..8eddae37e0 100644 --- a/crates/nu-cli/src/commands/skip_until.rs +++ b/crates/nu-cli/src/commands/skip_until.rs @@ -100,8 +100,8 @@ impl WholeStreamCommand for SkipUntil { trace!("RESULT = {:?}", result); match result { - Ok(ref v) if v.is_true() => true, - _ => false, + Ok(ref v) if v.is_true() => false, // stop skipping + _ => true, } } }) diff --git a/crates/nu-cli/tests/commands/skip_until.rs b/crates/nu-cli/tests/commands/skip_until.rs index f901e8b655..4748766caa 100644 --- a/crates/nu-cli/tests/commands/skip_until.rs +++ b/crates/nu-cli/tests/commands/skip_until.rs @@ -12,20 +12,20 @@ fn condition_is_met() { -------------------------------------------------------------------- Chicken Collection,29/04/2020,30/04/2020,31/04/2020, Yellow Chickens,,, - Andrés,1,1,1 - Jonathan,1,1,1 - Jason,1,1,1 - Yehuda,1,1,1 + Andrés,0,0,1 + Jonathan,0,0,1 + Jason,0,0,1 + Yehuda,0,0,1 Blue Chickens,,, - Andrés,1,1,2 - Jonathan,1,1,2 - Jason,1,1,2 - Yehuda,1,1,2 + Andrés,0,0,1 + Jonathan,0,0,1 + Jason,0,0,1 + Yehuda,0,0,2 Red Chickens,,, - Andrés,1,1,3 - Jonathan,1,1,3 - Jason,1,1,3 - Yehuda,1,1,3 + Andrés,0,0,1 + Jonathan,0,0,1 + Jason,0,0,1 + Yehuda,0,0,3 "#, )]); @@ -45,6 +45,6 @@ fn condition_is_met() { "# )); - assert_eq!(actual.out, "12"); + assert_eq!(actual.out, "6"); }) }