Merge pull request #232 from androbtech/unit-tests-wip

Introduced to-int into str plugin and unit tests coverage along with it.
This commit is contained in:
Jonathan Turner
2019-08-02 13:06:30 +12:00
committed by GitHub
2 changed files with 298 additions and 41 deletions

View File

@ -76,7 +76,7 @@ fn str_can_only_apply_one() {
"open caco3_plastics.csv | first 1 | str origin --downcase --upcase"
);
assert!(output.contains("Usage: str [--downcase, --upcase]"));
assert!(output.contains("Usage: str field [--downcase|--upcase|--to-int]"));
}
#[test]
@ -101,6 +101,17 @@ fn str_upcases() {
assert_eq!(output, "NUSHELL");
}
#[test]
fn str_converts_to_int() {
nu!(
output,
cwd("tests/fixtures/formats"),
"open caco3_plastics.csv | get 0 | str tariff_item --to-int | where tariff_item == 2509000000 | get tariff_item | echo $it"
);
assert_eq!(output, "2509000000");
}
#[test]
fn can_inc_version() {
nu!(