port over the reject command from nushell (#419)

* port over reject

* add some tests to src/tests
This commit is contained in:
Michael Angerman
2021-12-04 19:09:45 -08:00
committed by GitHub
parent 71a8eb6f8e
commit 03e22b071a
4 changed files with 181 additions and 0 deletions

View File

@ -1187,3 +1187,24 @@ fn comment_skipping_2() -> TestResult {
"40",
)
}
#[test]
fn command_filter_reject_1() -> TestResult {
run_test("[[lang, gems]; [nu, 100]] | reject gems", "{lang: nu}")
}
#[test]
fn command_filter_reject_2() -> TestResult {
run_test(
"[[lang, gems, grade]; [nu, 100, a]] | reject gems grade",
"{lang: nu}",
)
}
#[test]
fn command_filter_reject_3() -> TestResult {
run_test(
"[[lang, gems, grade]; [nu, 100, a]] | reject grade gems",
"{lang: nu}",
)
}