added various case conversion commands for str. Added the inflection … (#2363)

* added various case conversion commands for str. Added the inflection crate as a dependency

* lighten the restriction on the inflector dependency

* publishing the case commands

* fix typo

* fix kebab case test

* formatting
This commit is contained in:
Rick Richardson
2020-08-17 13:18:23 -07:00
committed by GitHub
parent a224cd38ab
commit f6ff6ab6e4
11 changed files with 484 additions and 2 deletions

View File

@ -97,6 +97,26 @@ fn upcases() {
})
}
#[test]
fn camelcases() {
Playground::setup("str_test_3", |dirs, sandbox| {
sandbox.with_files(vec![FileWithContent(
"sample.toml",
r#"
[dependency]
name = "THIS_IS_A_TEST"
"#,
)]);
let actual = nu!(
cwd: dirs.test(),
"open sample.toml | str camel-case dependency.name | get dependency.name | echo $it"
);
assert_eq!(actual.out, "thisIsATest");
})
}
#[test]
fn converts_to_int() {
let actual = nu!(