add "into int" behavior (#3279)

* add 'int' command

* create `into int` behavior

- forcibly overwrote prior implementation

```sh
git mv -f  crates/nu-command/src/commands/int_.rs crates/nu-command/src/commands/into_int.rs
```
- picked up prior work, polished and renamed

Co-authored-by: Saeed Rasooli <saeed.gnu@gmail.com>
This commit is contained in:
Eli Flanagan
2021-04-09 10:17:39 -04:00
committed by GitHub
parent b791d1ab0d
commit 556596bce8
2 changed files with 133 additions and 37 deletions

View File

@ -5,7 +5,7 @@ fn into_int_filesize() {
let actual = nu!(
cwd: ".", pipeline(
r#"
into-int 1kb | each {= $it / 1000 }
echo 1kb | into int | each {= $it / 1000 }
"#
));
@ -17,7 +17,7 @@ fn into_int_filesize2() {
let actual = nu!(
cwd: ".", pipeline(
r#"
into-int 1kib | each {= $it / 1024 }
echo 1kib | into int | each {= $it / 1024 }
"#
));
@ -29,7 +29,7 @@ fn into_int_int() {
let actual = nu!(
cwd: ".", pipeline(
r#"
into-int 1024 | each {= $it / 1024 }
echo 1024 | into int | each {= $it / 1024 }
"#
));