summaryrefslogtreecommitdiffstats
path: root/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present')
-rw-r--r--src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/in/case.rs1
-rw-r--r--src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/in/lib.rs1
-rw-r--r--src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/mod.rs18
-rw-r--r--src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/stderr.log1
-rw-r--r--src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/stdout.log0
5 files changed, 21 insertions, 0 deletions
diff --git a/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/in/case.rs b/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/in/case.rs
new file mode 100644
index 000000000..f328e4d9d
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/in/case.rs
@@ -0,0 +1 @@
+fn main() {}
diff --git a/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/in/lib.rs b/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/in/lib.rs
new file mode 100644
index 000000000..59760b549
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/in/lib.rs
@@ -0,0 +1 @@
+fn f() {}
diff --git a/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/mod.rs b/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/mod.rs
new file mode 100644
index 000000000..5e9e1b94c
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/mod.rs
@@ -0,0 +1,18 @@
+use cargo_test_support::prelude::*;
+use cargo_test_support::Project;
+
+use cargo_test_support::curr_dir;
+
+#[cargo_test]
+fn case() {
+ let project = Project::from_template(curr_dir!().join("in"));
+ let project_root = &project.root();
+
+ snapbox::cmd::Command::cargo_ui()
+ .arg_line("init --lib")
+ .current_dir(project_root)
+ .assert()
+ .code(101)
+ .stdout_matches_path(curr_dir!().join("stdout.log"))
+ .stderr_matches_path(curr_dir!().join("stderr.log"));
+}
diff --git a/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/stderr.log b/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/stderr.log
new file mode 100644
index 000000000..c08dce96b
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/stderr.log
@@ -0,0 +1 @@
+error: cannot have a package with multiple libraries, found both `case.rs` and `lib.rs`
diff --git a/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/stdout.log b/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/stdout.log
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/stdout.log