diff options
Diffstat (limited to 'src/tools/cargo/tests/testsuite/init/both_lib_and_bin')
3 files changed, 20 insertions, 0 deletions
diff --git a/src/tools/cargo/tests/testsuite/init/both_lib_and_bin/mod.rs b/src/tools/cargo/tests/testsuite/init/both_lib_and_bin/mod.rs new file mode 100644 index 000000000..c9232320a --- /dev/null +++ b/src/tools/cargo/tests/testsuite/init/both_lib_and_bin/mod.rs @@ -0,0 +1,19 @@ +use cargo_test_support::paths; +use cargo_test_support::prelude::*; + +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + let cwd = paths::root(); + + snapbox::cmd::Command::cargo_ui() + .arg_line("init --lib --bin") + .current_dir(&cwd) + .assert() + .code(101) + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert!(!cwd.join("Cargo.toml").is_file()); +} diff --git a/src/tools/cargo/tests/testsuite/init/both_lib_and_bin/stderr.log b/src/tools/cargo/tests/testsuite/init/both_lib_and_bin/stderr.log new file mode 100644 index 000000000..9d635a427 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/init/both_lib_and_bin/stderr.log @@ -0,0 +1 @@ +error: can't specify both lib and binary outputs diff --git a/src/tools/cargo/tests/testsuite/init/both_lib_and_bin/stdout.log b/src/tools/cargo/tests/testsuite/init/both_lib_and_bin/stdout.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/init/both_lib_and_bin/stdout.log |