summaryrefslogtreecommitdiffstats
path: root/tests/testsuite/init/simple_git
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:47:55 +0000
commit2aadc03ef15cb5ca5cc2af8a7c08e070742f0ac4 (patch)
tree033cc839730fda84ff08db877037977be94e5e3a /tests/testsuite/init/simple_git
parentInitial commit. (diff)
downloadcargo-2aadc03ef15cb5ca5cc2af8a7c08e070742f0ac4.tar.xz
cargo-2aadc03ef15cb5ca5cc2af8a7c08e070742f0ac4.zip
Adding upstream version 0.70.1+ds1.upstream/0.70.1+ds1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/testsuite/init/simple_git')
l---------tests/testsuite/init/simple_git/in1
-rw-r--r--tests/testsuite/init/simple_git/mod.rs22
-rw-r--r--tests/testsuite/init/simple_git/out/.gitignore2
-rw-r--r--tests/testsuite/init/simple_git/out/Cargo.toml8
-rw-r--r--tests/testsuite/init/simple_git/out/src/lib.rs14
-rw-r--r--tests/testsuite/init/simple_git/stderr.log1
-rw-r--r--tests/testsuite/init/simple_git/stdout.log0
7 files changed, 48 insertions, 0 deletions
diff --git a/tests/testsuite/init/simple_git/in b/tests/testsuite/init/simple_git/in
new file mode 120000
index 0000000..1202506
--- /dev/null
+++ b/tests/testsuite/init/simple_git/in
@@ -0,0 +1 @@
+../empty_dir \ No newline at end of file
diff --git a/tests/testsuite/init/simple_git/mod.rs b/tests/testsuite/init/simple_git/mod.rs
new file mode 100644
index 0000000..c373fe2
--- /dev/null
+++ b/tests/testsuite/init/simple_git/mod.rs
@@ -0,0 +1,22 @@
+use cargo_test_support::compare::assert_ui;
+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 --vcs git")
+ .current_dir(project_root)
+ .assert()
+ .success()
+ .stdout_matches_path(curr_dir!().join("stdout.log"))
+ .stderr_matches_path(curr_dir!().join("stderr.log"));
+
+ assert_ui().subset_matches(curr_dir!().join("out"), project_root);
+ assert!(project_root.join(".git").is_dir());
+}
diff --git a/tests/testsuite/init/simple_git/out/.gitignore b/tests/testsuite/init/simple_git/out/.gitignore
new file mode 100644
index 0000000..4fffb2f
--- /dev/null
+++ b/tests/testsuite/init/simple_git/out/.gitignore
@@ -0,0 +1,2 @@
+/target
+/Cargo.lock
diff --git a/tests/testsuite/init/simple_git/out/Cargo.toml b/tests/testsuite/init/simple_git/out/Cargo.toml
new file mode 100644
index 0000000..dcdb8da
--- /dev/null
+++ b/tests/testsuite/init/simple_git/out/Cargo.toml
@@ -0,0 +1,8 @@
+[package]
+name = "case"
+version = "0.1.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
diff --git a/tests/testsuite/init/simple_git/out/src/lib.rs b/tests/testsuite/init/simple_git/out/src/lib.rs
new file mode 100644
index 0000000..7d12d9a
--- /dev/null
+++ b/tests/testsuite/init/simple_git/out/src/lib.rs
@@ -0,0 +1,14 @@
+pub fn add(left: usize, right: usize) -> usize {
+ left + right
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn it_works() {
+ let result = add(2, 2);
+ assert_eq!(result, 4);
+ }
+}
diff --git a/tests/testsuite/init/simple_git/stderr.log b/tests/testsuite/init/simple_git/stderr.log
new file mode 100644
index 0000000..f459bf2
--- /dev/null
+++ b/tests/testsuite/init/simple_git/stderr.log
@@ -0,0 +1 @@
+ Created library package
diff --git a/tests/testsuite/init/simple_git/stdout.log b/tests/testsuite/init/simple_git/stdout.log
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/testsuite/init/simple_git/stdout.log