Port str case commands (#287)

* Port camel case and kebab case

* Port pascal case

* Port snake case and screaming snake case

* Cleanup before PR

* Add back cell path support for str case commands

* Add cell path tests for str case command

* Revert "Add cell path tests for str case command"

This reverts commit a0906318d95fd2b5e4f8ca42f547a7e4c5db381a.

* Add cell path test cases for str case command

* Move cell path tests from tests.rs to Examples in each of the command's file

Co-authored-by: Stefan Stanciulescu <contact@stefanstanciulescu.com>
This commit is contained in:
onthebridgetonowhere
2021-11-06 18:55:25 +01:00
committed by GitHub
parent 6c31377c21
commit a1f141d18a
12 changed files with 613 additions and 1 deletions

View File

@ -7,7 +7,7 @@ use nu_protocol::{
use crate::To;
use super::{Date, From, Into, Math, Split};
use super::{Case, Date, From, Into, Math, Split};
pub fn test_examples(cmd: impl Command + 'static) {
let examples = cmd.examples();
@ -17,6 +17,7 @@ pub fn test_examples(cmd: impl Command + 'static) {
// Base functions that are needed for testing
// Try to keep this working set small to keep tests running as fast as possible
let mut working_set = StateWorkingSet::new(&*engine_state);
working_set.add_decl(Box::new(Case));
working_set.add_decl(Box::new(From));
working_set.add_decl(Box::new(To));
working_set.add_decl(Box::new(Into));