mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 06:35:56 +02:00
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:
@ -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!(
|
||||
|
Reference in New Issue
Block a user