mirror of
https://github.com/nushell/nushell.git
synced 2025-08-15 01:33:06 +02:00
.azureold
.cargo
.github
assets
crates
nu-cli
nu-color-config
nu-command
assets
src
tests
commands
hash_
keep
math
move_
path
random
skip
str_
alias.rs
all.rs
any.rs
append.rs
cal.rs
cd.rs
compact.rs
cp.rs
def.rs
default.rs
drop.rs
each.rs
echo.rs
empty.rs
enter.rs
every.rs
find.rs
first.rs
flatten.rs
format.rs
get.rs
group_by.rs
headers.rs
help.rs
histogram.rs
insert.rs
into_filesize.rs
into_int.rs
last.rs
length.rs
lines.rs
ls.rs
merge.rs
mkdir.rs
mod.rs
open.rs
parse.rs
prepend.rs
range.rs
reduce.rs
reject.rs
rename.rs
reverse.rs
rm.rs
roll.rs
rotate.rs
run_external.rs
save.rs
select.rs
semicolon.rs
sort_by.rs
source.rs
split_by.rs
split_column.rs
split_row.rs
touch.rs
uniq.rs
update.rs
upsert.rs
use_.rs
where_.rs
which.rs
with_env.rs
wrap.rs
zip.rs
format_conversions
main.rs
Cargo.toml
build.rs
nu-engine
nu-glob
nu-json
nu-parser
nu-path
nu-plugin
nu-pretty-hex
nu-protocol
nu-system
nu-table
nu-term-grid
nu-test-support
nu-utils
nu_plugin_example
nu_plugin_gstat
nu_plugin_inc
nu_plugin_python
nu_plugin_query
old
README.md
docs
images
pkg_mgrs
samples
src
tests
wix
.gitignore
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Cargo.lock
Cargo.toml
Cargo.toml.old
LICENSE
Makefile.toml
README.build.txt
README.md
build-all-maclin.sh
build-all-windows.cmd
build-all.nu
build.rs
install-all.ps1
install-all.sh
rustfmt.toml
uninstall-all.sh
29 lines
735 B
Rust
29 lines
735 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
|
|
| str trim
|
|
| split column ","
|
|
| get column2
|
|
"#
|
|
));
|
|
|
|
assert!(actual.out.contains("shipper"));
|
|
})
|
|
}
|