Skip to content

Commit 9171e18

Browse files
committed
Migrate tests of cargo-init to snapbox
Some redundant tests are merged or deleted. - `gitignore_appended_not_replaced` -> `git_ignore_exists_no_conflicting_entries` - `gitignore_added_newline_in_existing` -> `git_ignore_exists_no_conflicting_entries` - `gitignore_no_newline_in_new` -> `simple_git` - `terminating_newline_in_existing_git_ignore` -> `git_ignore_exists_no_conflicting_entries` - `terminating_newline_in_new_git_ignore` -> `simple_git` - `terminating_newline_in_new_mercurial_ignore` -> `simple_hg` - `terminating_newline_in_existing_mercurial_ignore` -> `simple_hg_ignore_exists` - `mercurial_added_newline_in_existing` -> `simple_hg_ignore_exists` - `mercurial_no_newline_in_new` -> `simple_hg` - `cargo_lock_gitignored_if_lib1` -> `simple_git` - `cargo_lock_gitignored_if_lib2` -> `inferred_lib_with_git` - `cargo_lock_not_gitignored_if_bin2` -> `inferred_bin_with_git` - `cargo_lock_not_gitignored_if_bin1` -> `explicit_bin_with_git`
1 parent fb2532a commit 9171e18

File tree

193 files changed

+1101
-506
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+1101
-506
lines changed

tests/snapshots/init/auto_git.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
empty-dir
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/target
2+
/Cargo.lock
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "case"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#[cfg(test)]
2+
mod tests {
3+
#[test]
4+
fn it_works() {
5+
let result = 2 + 2;
6+
assert_eq!(result, 4);
7+
}
8+
}

tests/snapshots/init/auto_git.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Created library package

tests/snapshots/init/auto_git.stdout

Whitespace-only changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main() {
2+
println!("Check that our file is not overwritten")
3+
}
4+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "case"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main() {
2+
println!("Check that our file is not overwritten")
3+
}
4+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Created binary (application) package

0 commit comments

Comments
 (0)