mirror of
https://github.com/nushell/nushell.git
synced 2025-07-25 07:05:50 +02:00
.cargo
.github
assets
crates
nu-cli
nu-color-config
nu-command
assets
proptest-regressions
src
tests
commands
date
hash_
math
move_
network
path
platform
query
random
skip
str_
take
alias.rs
all.rs
any.rs
append.rs
cal.rs
cd.rs
compact.rs
cp.rs
def.rs
default.rs
do_.rs
drop.rs
each.rs
echo.rs
empty.rs
enter.rs
error_make.rs
every.rs
export_def.rs
find.rs
first.rs
flatten.rs
format.rs
g.rs
get.rs
group_by.rs
headers.rs
help.rs
histogram.rs
insert.rs
into_filesize.rs
into_int.rs
last.rs
length.rs
let_.rs
lines.rs
ls.rs
merge.rs
mkdir.rs
mod.rs
n.rs
nu_check.rs
open.rs
p.rs
parse.rs
prepend.rs
print.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
shells.rs
sort_by.rs
source_env.rs
split_by.rs
split_column.rs
split_row.rs
touch.rs
transpose.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
LICENSE
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_custom_values
nu_plugin_example
nu_plugin_gstat
nu_plugin_inc
nu_plugin_python
nu_plugin_query
old
README.md
docker
docs
images
pkg_mgrs
samples
src
tests
wix
.gitignore
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Cargo.lock
Cargo.toml
LICENSE
README.md
README.release.txt
build-all-maclin.sh
build-all-windows.cmd
build-all.nu
build.rs
install-all.ps1
install-all.sh
register-plugins.nu
rust-toolchain.toml
uninstall-all.sh
* 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
36 lines
1.0 KiB
Rust
36 lines
1.0 KiB
Rust
use nu_test_support::fs::Stub::FileWithContentToBeTrimmed;
|
|
use nu_test_support::playground::Playground;
|
|
use nu_test_support::{nu, pipeline};
|
|
|
|
#[test]
|
|
fn adds_row_data_if_column_missing() {
|
|
Playground::setup("default_test_1", |dirs, sandbox| {
|
|
sandbox.with_files(vec![FileWithContentToBeTrimmed(
|
|
"los_tres_amigos.json",
|
|
r#"
|
|
{
|
|
"amigos": [
|
|
{"name": "Yehuda"},
|
|
{"name": "Jonathan", "rusty_luck": 0},
|
|
{"name": "Andres", "rusty_luck": 0},
|
|
{"name":"GorbyPuff"}
|
|
]
|
|
}
|
|
"#,
|
|
)]);
|
|
|
|
let actual = nu!(
|
|
cwd: dirs.test(), pipeline(
|
|
r#"
|
|
open los_tres_amigos.json
|
|
| get amigos
|
|
| default rusty_luck 1
|
|
| where rusty_luck == 1
|
|
| length
|
|
"#
|
|
));
|
|
|
|
assert_eq!(actual.out, "2");
|
|
});
|
|
}
|