mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 06:30:08 +02:00
Fix issue 6223 (#6241)
* Fix6223 * clippy fix Co-authored-by: Frank <v-frankz@microsoft.com>
This commit is contained in:
31
crates/nu-command/tests/commands/g.rs
Normal file
31
crates/nu-command/tests/commands/g.rs
Normal file
@ -0,0 +1,31 @@
|
||||
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"));
|
||||
}
|
@ -22,6 +22,7 @@ mod find;
|
||||
mod first;
|
||||
mod flatten;
|
||||
mod format;
|
||||
mod g;
|
||||
mod get;
|
||||
mod group_by;
|
||||
mod hash_;
|
||||
|
Reference in New Issue
Block a user