mirror of
https://github.com/nushell/nushell.git
synced 2025-08-15 02:02:35 +02:00
str collect
=> str join
(#6531)
* Initialize join.rs as a copy of collect.rs * Evolve StrCollect into StrJoin * Replace 'str collect' with 'str join' everywhere git ls-files | lines | par-each { |it| sed -i 's,str collect,str join,g' $it } * Deprecate 'str collect' * Revert "Deprecate 'str collect'" This reverts commit959d14203e
. * Change `str collect` help message to say that it is deprecated We cannot remove `str collect` currently (i.e. via `nu_protocol::ShellError::DeprecatedCommand` since a prominent project uses the API:b85542c31c/src/virtualenv/activation/nushell/activate.nu (L43)
This commit is contained in:
@ -5,7 +5,7 @@ fn test_1() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
echo 1..5 | into string | str collect
|
||||
echo 1..5 | into string | str join
|
||||
"#
|
||||
)
|
||||
);
|
||||
@ -18,7 +18,7 @@ fn test_2() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
echo [a b c d] | str collect "<sep>"
|
||||
echo [a b c d] | str join "<sep>"
|
||||
"#
|
||||
)
|
||||
);
|
||||
@ -31,7 +31,7 @@ fn construct_a_path() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
echo [sample txt] | str collect "."
|
||||
echo [sample txt] | str join "."
|
||||
"#
|
||||
)
|
||||
);
|
||||
@ -44,7 +44,7 @@ fn sum_one_to_four() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
1..4 | each { |it| $it } | into string | str collect "+" | math eval
|
||||
1..4 | each { |it| $it } | into string | str join "+" | math eval
|
||||
"#
|
||||
)
|
||||
);
|
||||
|
Reference in New Issue
Block a user