nushell/crates/nu-command/tests/commands/into_int.rs

26 lines
435 B
Rust
Raw Normal View History

use nu_test_support::{nu, pipeline};
#[test]
fn into_int_filesize() {
let actual = nu!(
cwd: ".", pipeline(
r#"
into-int 1kb | each {= $it / 1024 }
"#
));
2020-10-08 23:47:51 +02:00
assert!(actual.out.contains('1'));
}
#[test]
fn into_int_int() {
let actual = nu!(
cwd: ".", pipeline(
r#"
into-int 1024 | each {= $it / 1024 }
"#
));
2020-10-08 23:47:51 +02:00
assert!(actual.out.contains('1'));
}