mirror of
https://github.com/nushell/nushell.git
synced 2025-08-16 02:18:44 +02:00
.azure
.cargo
.circleci
.github
.theia
assets
crates
nu-build
nu-cli
src
tests
commands
alias.rs
append.rs
average.rs
cal.rs
calc.rs
cd.rs
compact.rs
cp.rs
default.rs
drop.rs
each.rs
enter.rs
first.rs
format.rs
get.rs
group_by.rs
headers.rs
histogram.rs
insert.rs
is_empty.rs
keep.rs
keep_until.rs
keep_while.rs
last.rs
lines.rs
ls.rs
math.rs
merge.rs
mkdir.rs
mod.rs
mv.rs
nth.rs
open.rs
parse.rs
prepend.rs
range.rs
rename.rs
reverse.rs
rm.rs
save.rs
select.rs
semicolon.rs
skip_until.rs
sort_by.rs
split_by.rs
split_column.rs
split_row.rs
str_.rs
sum.rs
touch.rs
trim.rs
uniq.rs
update.rs
where_.rs
with_env.rs
wrap.rs
format_conversions
main.rs
Cargo.toml
nu-errors
nu-parser
nu-plugin
nu-protocol
nu-source
nu-test-support
nu-value-ext
nu_plugin_binaryview
nu_plugin_fetch
nu_plugin_inc
nu_plugin_match
nu_plugin_parse
nu_plugin_post
nu_plugin_ps
nu_plugin_start
nu_plugin_sys
nu_plugin_textview
nu_plugin_tree
debian
docker
docs
images
src
tests
.dockerignore
.editorconfig
.gitignore
.gitpod.Dockerfile
.gitpod.yml
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Cargo.lock
Cargo.toml
LICENSE
Makefile.toml
README.md
TODO.md
build.rs
features.toml
rustfmt.toml
32 lines
665 B
Rust
32 lines
665 B
Rust
use nu_test_support::{nu, pipeline};
|
|
|
|
#[test]
|
|
fn headers_uses_first_row_as_header() {
|
|
let actual = nu!(
|
|
cwd: "tests/fixtures/formats", pipeline(
|
|
r#"
|
|
open sample_headers.xlsx
|
|
| get Sheet1
|
|
| headers
|
|
| get header0
|
|
| from json"#
|
|
));
|
|
|
|
assert_eq!(actual.out, "r1c0r2c0")
|
|
}
|
|
|
|
#[test]
|
|
fn headers_adds_missing_column_name() {
|
|
let actual = nu!(
|
|
cwd: "tests/fixtures/formats", pipeline(
|
|
r#"
|
|
open sample_headers.xlsx
|
|
| get Sheet1
|
|
| headers
|
|
| get Column1
|
|
| from json"#
|
|
));
|
|
|
|
assert_eq!(actual.out, "r1c1r2c1")
|
|
}
|