nushell/crates/nu-command/tests/commands/seq.rs
pwygab 3395beaa56
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.
2022-12-06 18:48:03 -08:00

25 lines
498 B
Rust

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>");
}