Document fn pipeline() used with nu! tests (#9609)

# Description
Its purpose and its limitation around statements are not too obvious but
ubiquituous in our `nu!` tests. Document its behavior as we remove it in
many places for #8670


# User-Facing Changes
None
This commit is contained in:
Stefan Holderbach 2023-07-05 13:19:54 +02:00 committed by GitHub
parent 53cd4df806
commit 168e7f7b16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,6 +27,9 @@ impl Outcome {
} }
} }
/// Reformat a multiline pipeline into a single line for use with `nu -c`
///
/// Warning: Will not correctly handle statements that are not `;` separated!
pub fn pipeline(commands: &str) -> String { pub fn pipeline(commands: &str) -> String {
commands commands
.trim() .trim()