mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Make seq
return a ListStream
where possible (#7367)
# Description Title. # User-Facing Changes Faster seq that works better with functions that take in `ListStream`s. # Tests + Formatting Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass # After Submitting If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date.
This commit is contained in:
@ -72,6 +72,7 @@ mod run_external;
|
||||
mod save;
|
||||
mod select;
|
||||
mod semicolon;
|
||||
mod seq;
|
||||
mod seq_char;
|
||||
mod shells;
|
||||
mod skip;
|
||||
|
25
crates/nu-command/tests/commands/seq.rs
Normal file
25
crates/nu-command/tests/commands/seq.rs
Normal file
@ -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>");
|
||||
}
|
Reference in New Issue
Block a user