Add support for custom subcommands (#2814)

* Add support for custom subcommands

* clippy
This commit is contained in:
Jonathan Turner
2020-12-23 20:43:56 +13:00
committed by GitHub
parent 1e67ae8e94
commit f22938fc4a
2 changed files with 15 additions and 4 deletions

View File

@@ -368,6 +368,18 @@ fn run_custom_command_with_flag_missing() {
assert_eq!(actual.out, "empty");
}
#[test]
fn run_custom_subcommand() {
let actual = nu!(
cwd: ".",
r#"
def "str double" [x] { echo $x $x | str collect }; str double bob
"#
);
assert_eq!(actual.out, "bobbob");
}
#[test]
fn set_variable() {
let actual = nu!(