2020-08-27 07:44:18 +02:00
|
|
|
use nu_test_support::{nu, pipeline};
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn into_int_filesize() {
|
|
|
|
let actual = nu!(
|
|
|
|
cwd: ".", pipeline(
|
|
|
|
r#"
|
2021-02-10 03:31:12 +01:00
|
|
|
into-int 1kb | each {= $it / 1000 }
|
|
|
|
"#
|
|
|
|
));
|
|
|
|
|
|
|
|
assert!(actual.out.contains('1'));
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn into_int_filesize2() {
|
|
|
|
let actual = nu!(
|
|
|
|
cwd: ".", pipeline(
|
|
|
|
r#"
|
|
|
|
into-int 1kib | each {= $it / 1024 }
|
2020-08-27 07:44:18 +02:00
|
|
|
"#
|
|
|
|
));
|
|
|
|
|
2020-10-08 23:47:51 +02:00
|
|
|
assert!(actual.out.contains('1'));
|
2020-08-27 07:44:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn into_int_int() {
|
|
|
|
let actual = nu!(
|
|
|
|
cwd: ".", pipeline(
|
|
|
|
r#"
|
2020-10-26 07:55:52 +01:00
|
|
|
into-int 1024 | each {= $it / 1024 }
|
2020-08-27 07:44:18 +02:00
|
|
|
"#
|
|
|
|
));
|
|
|
|
|
2020-10-08 23:47:51 +02:00
|
|
|
assert!(actual.out.contains('1'));
|
2020-08-27 07:44:18 +02:00
|
|
|
}
|