mirror of
https://github.com/nushell/nushell
synced 2024-12-30 15:03:25 +00:00
63e220a763
* Refactor shell switching related code Signed-off-by: nibon7 <nibon7@163.com> * add tests Signed-off-by: nibon7 <nibon7@163.com> * fix tests Signed-off-by: nibon7 <nibon7@163.com>
31 lines
766 B
Rust
31 lines
766 B
Rust
use nu_test_support::{nu, pipeline, playground::Playground};
|
|
|
|
#[test]
|
|
fn switch_to_next_shell_1() {
|
|
Playground::setup("switch_to_next_shell_1", |dirs, sandbox| {
|
|
sandbox.mkdir("foo").mkdir("bar");
|
|
|
|
let actual = nu!(
|
|
cwd: dirs.test(),
|
|
pipeline(
|
|
r#"enter foo; enter ../bar; n; g | get active.0"#
|
|
));
|
|
|
|
assert_eq!(actual.out, "true");
|
|
})
|
|
}
|
|
|
|
#[test]
|
|
fn switch_to_next_shell_2() {
|
|
Playground::setup("switch_to_next_shell_2", |dirs, sandbox| {
|
|
sandbox.mkdir("foo").mkdir("bar");
|
|
|
|
let actual = nu!(
|
|
cwd: dirs.test(),
|
|
pipeline(
|
|
r#"enter foo; enter ../bar; n; n; g | get active.1"#
|
|
));
|
|
|
|
assert_eq!(actual.out, "true");
|
|
})
|
|
}
|