Fix issue 6223 (#6241)

* Fix6223

* clippy fix

Co-authored-by: Frank <v-frankz@microsoft.com>
This commit is contained in:
Kangaxx-0
2022-08-06 05:09:14 -07:00
committed by GitHub
parent 34ab4d8360
commit a217bc0715
3 changed files with 88 additions and 26 deletions

View 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"));
}

View File

@ -22,6 +22,7 @@ mod find;
mod first;
mod flatten;
mod format;
mod g;
mod get;
mod group_by;
mod hash_;