Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make seq return a ListStream where possible #7367

Merged
merged 2 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add tests
  • Loading branch information
merelymyself committed Dec 6, 2022
commit 4e7e120ea9c930e15e0f85533e8aaec552fd2e45
1 change: 1 addition & 0 deletions crates/nu-command/tests/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ mod run_external;
mod save;
mod select;
mod semicolon;
mod seq;
mod seq_char;
mod shells;
mod skip;
Expand Down
25 changes: 25 additions & 0 deletions crates/nu-command/tests/commands/seq.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use nu_test_support::{nu, pipeline};

#[test]
fn float_in_seq_leads_to_lists_of_floats() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
seq 1.0 0.5 6 | describe
"#
));

assert_eq!(actual.out, "list<float>");
}

#[test]
fn ints_in_seq_leads_to_lists_of_ints() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
seq 1 2 6 | describe
"#
));

assert_eq!(actual.out, "list<int>");
}