mirror of
https://github.com/nushell/nushell.git
synced 2025-08-16 13:51:01 +02:00
Command tests (#922)
* WIP command tests * Finish marking todo tests * update * update * Windows cd test ignoring
This commit is contained in:
37
crates/nu-command/tests/commands/into_int.rs
Normal file
37
crates/nu-command/tests/commands/into_int.rs
Normal file
@ -0,0 +1,37 @@
|
||||
use nu_test_support::{nu, pipeline};
|
||||
|
||||
#[test]
|
||||
fn into_int_filesize() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
echo 1kb | into int | each { $it / 1000 }
|
||||
"#
|
||||
));
|
||||
|
||||
assert!(actual.out.contains('1'));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn into_int_filesize2() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
echo 1kib | into int | each { $it / 1024 }
|
||||
"#
|
||||
));
|
||||
|
||||
assert!(actual.out.contains('1'));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn into_int_int() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
echo 1024 | into int | each { $it / 1024 }
|
||||
"#
|
||||
));
|
||||
|
||||
assert!(actual.out.contains('1'));
|
||||
}
|
Reference in New Issue
Block a user