mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 02:55:07 +02:00
RangeIterator can also go down (#2913)
This commit is contained in:
@ -11,3 +11,51 @@ fn echo_range_is_lazy() {
|
||||
|
||||
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 | to json
|
||||
"#
|
||||
));
|
||||
|
||||
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 | to json
|
||||
"#
|
||||
));
|
||||
|
||||
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 | to json
|
||||
"#
|
||||
));
|
||||
|
||||
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 | to json
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "[3,2]");
|
||||
}
|
||||
|
Reference in New Issue
Block a user