forked from extern/nushell
c13fe83784
* update docs to refer to length instead of count * rename count to length * change all occurrences of 'count' to 'length' in tests * format length command
29 lines
715 B
Rust
29 lines
715 B
Rust
use nu_test_support::fs::Stub::FileWithContentToBeTrimmed;
|
|
use nu_test_support::playground::Playground;
|
|
use nu_test_support::{nu, pipeline};
|
|
|
|
#[test]
|
|
fn to_row() {
|
|
Playground::setup("split_row_test_1", |dirs, sandbox| {
|
|
sandbox.with_files(vec![FileWithContentToBeTrimmed(
|
|
"sample.txt",
|
|
r#"
|
|
importer,shipper,tariff_item,name,origin
|
|
"#,
|
|
)]);
|
|
|
|
let actual = nu!(
|
|
cwd: dirs.test(), pipeline(
|
|
r#"
|
|
open sample.txt
|
|
| lines
|
|
| str trim
|
|
| split row ","
|
|
| length
|
|
"#
|
|
));
|
|
|
|
assert!(actual.out.contains('5'));
|
|
})
|
|
}
|