mirror of
https://github.com/nushell/nushell.git
synced 2024-12-18 05:02:06 +01:00
656f707a0b
# Description The working directory doesn't have to be set for those tests (or would be the default anyways). When appropriate also remove calls to the `pipeline()` function. In most places kept the diff minimal and only removed the superfluous part to not pollute the blame view. With simpler tests also simplified things to make them more readable overall (this included removal of the raw string literal). Work for #8670
35 lines
567 B
Rust
35 lines
567 B
Rust
use nu_test_support::{nu, pipeline};
|
|
|
|
#[test]
|
|
fn test_1() {
|
|
let actual = nu!(pipeline(
|
|
r#"
|
|
echo 1..5 | into string | str join
|
|
"#
|
|
));
|
|
|
|
assert_eq!(actual.out, "12345");
|
|
}
|
|
|
|
#[test]
|
|
fn test_2() {
|
|
let actual = nu!(pipeline(
|
|
r#"
|
|
echo [a b c d] | str join "<sep>"
|
|
"#
|
|
));
|
|
|
|
assert_eq!(actual.out, "a<sep>b<sep>c<sep>d");
|
|
}
|
|
|
|
#[test]
|
|
fn construct_a_path() {
|
|
let actual = nu!(pipeline(
|
|
r#"
|
|
echo [sample txt] | str join "."
|
|
"#
|
|
));
|
|
|
|
assert_eq!(actual.out, "sample.txt");
|
|
}
|