From 8dc08dccba9e620ca346aef6c3132cbd933d3edf Mon Sep 17 00:00:00 2001 From: Marsman1996 Date: Thu, 8 Aug 2024 16:11:26 +0800 Subject: [PATCH] Add test for new crate with hypen --- osdk/tests/cli/mod.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/osdk/tests/cli/mod.rs b/osdk/tests/cli/mod.rs index ed909baaf..4a7fbc1fd 100644 --- a/osdk/tests/cli/mod.rs +++ b/osdk/tests/cli/mod.rs @@ -1,5 +1,7 @@ // SPDX-License-Identifier: MPL-2.0 +use std::fs; + use crate::util::*; #[test] @@ -50,3 +52,13 @@ fn cli_clippy_help_message() { assert_success(&output); assert_stdout_contains_msg(&output, "cargo osdk clippy"); } + +#[test] +fn cli_new_crate_with_hyphen() { + let output = cargo_osdk(&["new", "--kernel", "my-first-os"]) + .output() + .unwrap(); + assert_success(&output); + assert!(fs::metadata("my-first-os").is_ok()); + fs::remove_dir_all("my-first-os"); +}