mirror of
https://github.com/nushell/nushell.git
synced 2024-12-28 01:49:20 +01:00
31 lines
776 B
Rust
31 lines
776 B
Rust
use nu_test_support::fs::Stub::FileWithContentToBeTrimmed;
|
|
use nu_test_support::playground::Playground;
|
|
use nu_test_support::{nu, pipeline};
|
|
|
|
#[test]
|
|
fn to_column() {
|
|
Playground::setup("split_column_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
|
|
| trim
|
|
| split column ","
|
|
| pivot
|
|
| nth 1
|
|
| echo $it
|
|
"#
|
|
));
|
|
|
|
assert!(actual.out.contains("shipper"));
|
|
})
|
|
}
|