Add reduce command (#700)

* Add reduce command

* Fix example and missing test commands

* Add forgotten file
This commit is contained in:
Jakub Žádník
2022-01-08 02:40:40 +02:00
committed by GitHub
parent f964ce9bc0
commit 3b467bedd9
5 changed files with 231 additions and 1 deletions

View File

@ -12,7 +12,10 @@ use nu_protocol::{
use crate::To;
#[cfg(test)]
use super::{Ansi, Date, From, Into, Math, Path, Random, Split, Str, StrCollect, Url};
use super::{
Ansi, Date, From, If, Into, Math, Path, Random, Split, Str, StrCollect, StrFindReplace,
StrLength, Url,
};
#[cfg(test)]
pub fn test_examples(cmd: impl Command + 'static) {
@ -27,8 +30,11 @@ pub fn test_examples(cmd: impl Command + 'static) {
let mut working_set = StateWorkingSet::new(&*engine_state);
working_set.add_decl(Box::new(Str));
working_set.add_decl(Box::new(StrCollect));
working_set.add_decl(Box::new(StrLength));
working_set.add_decl(Box::new(StrFindReplace));
working_set.add_decl(Box::new(BuildString));
working_set.add_decl(Box::new(From));
working_set.add_decl(Box::new(If));
working_set.add_decl(Box::new(To));
working_set.add_decl(Box::new(Into));
working_set.add_decl(Box::new(Random));