mirror of
https://github.com/nushell/nushell
synced 2025-01-13 21:55:07 +00:00
Fix signature of split row
(#9829)
# Description This command also flat-maps and doesn't create a table like `split column` We should probably reconsider the flatmap behavior like in #9739 but for the #9812 hotfix this is an unwelcome breaking change. # User-Facing Changes None # Tests + Formatting - Fix signature of `split row` - Add test for output signature
This commit is contained in:
parent
78e29af423
commit
3481c7e242
2 changed files with 13 additions and 1 deletions
|
@ -18,7 +18,10 @@ impl Command for SubCommand {
|
||||||
Signature::build("split row")
|
Signature::build("split row")
|
||||||
.input_output_types(vec![
|
.input_output_types(vec![
|
||||||
(Type::String, Type::List(Box::new(Type::String))),
|
(Type::String, Type::List(Box::new(Type::String))),
|
||||||
(Type::List(Box::new(Type::String)), Type::Table(vec![])),
|
(
|
||||||
|
Type::List(Box::new(Type::String)),
|
||||||
|
(Type::List(Box::new(Type::String))),
|
||||||
|
),
|
||||||
])
|
])
|
||||||
.allow_variants_without_examples(true)
|
.allow_variants_without_examples(true)
|
||||||
.required(
|
.required(
|
||||||
|
|
|
@ -45,5 +45,14 @@ fn to_row() {
|
||||||
));
|
));
|
||||||
|
|
||||||
assert!(actual.out.contains('5'));
|
assert!(actual.out.contains('5'));
|
||||||
|
|
||||||
|
let actual = nu!(r#"
|
||||||
|
def foo [a: list<string>] {
|
||||||
|
$a | describe
|
||||||
|
}
|
||||||
|
foo (["a b", "c d"] | split row " ")
|
||||||
|
"#);
|
||||||
|
|
||||||
|
assert!(actual.out.contains("list<string>"));
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue