mirror of
https://github.com/nushell/nushell
synced 2024-12-30 15:03:25 +00:00
95d4922e44
Closes #7581. After this PR, `describe` shows `(stream)` next to input that arrived at `describe` as a `ListStream`: ```bash 〉ls | describe table<name: string, type: string, size: filesize, modified: date> (stream) 〉[1 2 3] | each {|i| $i} | describe list<int> (stream) ``` `describe` must collect all items of the stream to display type information for lists and tables. If users need to avoid collecting input, they can use the `-n`/`--no-collect` flag: ```bash 〉[1 2 3] | each {|i| $i} | describe --no-collect stream ```
25 lines
516 B
Rust
25 lines
516 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> (stream)");
|
|
}
|
|
|
|
#[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> (stream)");
|
|
}
|