nushell/crates/nu-command/tests/commands/g.rs
Kangaxx-0 a217bc0715
Fix issue 6223 (#6241)
* Fix6223

* clippy fix

Co-authored-by: Frank <v-frankz@microsoft.com>
2022-08-06 07:09:14 -05:00

32 lines
500 B
Rust

use nu_test_support::{nu, pipeline};
#[test]
fn list_shells() {
let actual = nu!(
cwd: ".", pipeline(
r#"g | get path | length "#
));
assert_eq!(actual.out, "1");
}
#[test]
fn enter_shell() {
let actual = nu!(
cwd: ".", pipeline(
r#"g 0"#
));
assert!(actual.err.is_empty());
}
#[test]
fn enter_not_exist_shell() {
let actual = nu!(
cwd: ".", pipeline(
r#"g 1"#
));
assert!(actual.err.contains("Not found"));
}