1
0
mirror of https://github.com/nushell/nushell.git synced 2025-07-14 05:15:23 +02:00
Files
.cargo
.github
assets
crates
nu-cli
nu-color-config
nu-command
assets
src
tests
commands
hash_
math
move_
path
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
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
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_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
build-all-maclin.sh
build-all-windows.cmd
build-all.nu
build.rs
install-all.ps1
install-all.sh
uninstall-all.sh
nushell/crates/nu-command/tests/commands/echo.rs
JT 6e733f49bc Require block params ()
* Require block params

* Improve errors
2022-02-17 06:40:24 -05:00

62 lines
1.2 KiB
Rust

use nu_test_support::{nu, pipeline};
#[test]
fn echo_range_is_lazy() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
echo 1..10000000000 | first 3 | to json --raw
"#
));
assert_eq!(actual.out, "[1,2,3]");
}
#[test]
fn echo_range_handles_inclusive() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
echo 1..3 | each { |x| $x } | to json --raw
"#
));
assert_eq!(actual.out, "[1,2,3]");
}
#[test]
fn echo_range_handles_exclusive() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
echo 1..<3 | each { |x| $x } | to json --raw
"#
));
assert_eq!(actual.out, "[1,2]");
}
#[test]
fn echo_range_handles_inclusive_down() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
echo 3..1 | each { |it| $it } | to json --raw
"#
));
assert_eq!(actual.out, "[3,2,1]");
}
#[test]
fn echo_range_handles_exclusive_down() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
echo 3..<1 | each { |it| $it } | to json --raw
"#
));
assert_eq!(actual.out, "[3,2]");
}