mirror of
https://github.com/nushell/nushell.git
synced 2024-11-23 17:03:45 +01:00
2f0cb044a5
* Refactor shell listing related code Signed-off-by: nibon7 <nibon7@163.com> * add test Signed-off-by: nibon7 <nibon7@163.com>
32 lines
724 B
Rust
32 lines
724 B
Rust
use nu_test_support::{nu, pipeline, playground::Playground};
|
|
|
|
#[test]
|
|
fn list_shells_1() {
|
|
Playground::setup("list_shells_1", |dirs, sandbox| {
|
|
sandbox.mkdir("foo").mkdir("bar");
|
|
|
|
let actual = nu!(
|
|
cwd: dirs.test(),
|
|
pipeline(
|
|
r#"enter foo; enter ../bar; g| get active.2"#
|
|
));
|
|
|
|
assert_eq!(actual.out, "true");
|
|
})
|
|
}
|
|
|
|
#[test]
|
|
fn list_shells_2() {
|
|
Playground::setup("list_shells_2", |dirs, sandbox| {
|
|
sandbox.mkdir("foo").mkdir("bar");
|
|
|
|
let actual = nu!(
|
|
cwd: dirs.test(),
|
|
pipeline(
|
|
r#"enter foo; enter ../bar; shells| get active.2"#
|
|
));
|
|
|
|
assert_eq!(actual.out, "true");
|
|
})
|
|
}
|