-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
- Loading branch information
1 parent
89c6a6f
commit efc39fb
Showing
12 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
tests/testsuite/init/inherit_workspace_package_table/in/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[workspace] | ||
members = [ | ||
"crates/*", | ||
] | ||
|
||
[workspace.package] | ||
authors = ["Rustaceans"] | ||
description = "foo" | ||
edition = "2018" | ||
homepage = "foo" | ||
keywords = ["foo", "bar"] | ||
readme = "README.md" | ||
rust-version = "1.67.0" | ||
categories = ["algorithms"] | ||
documentation = "foo" | ||
exclude = ["foo"] | ||
include = ["foo"] | ||
license = "MIT OR Apache-2.0" | ||
publish = false | ||
repository = "foo" | ||
version = "1.2.3" |
Empty file.
3 changes: 3 additions & 0 deletions
3
tests/testsuite/init/inherit_workspace_package_table/in/crates/foo/src/main.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
println!("Check that our file is not overwritten") | ||
} |
14 changes: 14 additions & 0 deletions
14
tests/testsuite/init/inherit_workspace_package_table/in/src/lib.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
tests/testsuite/init/inherit_workspace_package_table/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use cargo_test_support::compare::assert_ui; | ||
use cargo_test_support::curr_dir; | ||
use cargo_test_support::CargoCommand; | ||
use cargo_test_support::Project; | ||
|
||
#[cargo_test] | ||
fn case() { | ||
let project = Project::from_template(curr_dir!().join("in")); | ||
let project_root = project.root(); | ||
let cwd = &project_root; | ||
|
||
snapbox::cmd::Command::cargo_ui() | ||
.arg("init") | ||
.args(["crates/foo"]) | ||
.current_dir(cwd) | ||
.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); | ||
} |
21 changes: 21 additions & 0 deletions
21
tests/testsuite/init/inherit_workspace_package_table/out/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[workspace] | ||
members = [ | ||
"crates/*", | ||
] | ||
|
||
[workspace.package] | ||
authors = ["Rustaceans"] | ||
description = "foo" | ||
edition = "2018" | ||
homepage = "foo" | ||
keywords = ["foo", "bar"] | ||
readme = "README.md" | ||
rust-version = "1.67.0" | ||
categories = ["algorithms"] | ||
documentation = "foo" | ||
exclude = ["foo"] | ||
include = ["foo"] | ||
license = "MIT OR Apache-2.0" | ||
publish = false | ||
repository = "foo" | ||
version = "1.2.3" |
20 changes: 20 additions & 0 deletions
20
tests/testsuite/init/inherit_workspace_package_table/out/crates/foo/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[package] | ||
name = "foo" | ||
version.workspace = true | ||
edition.workspace = true | ||
publish.workspace = true | ||
authors.workspace = true | ||
categories.workspace = true | ||
description.workspace = true | ||
documentation.workspace = true | ||
exclude.workspace = true | ||
homepage.workspace = true | ||
include.workspace = true | ||
keywords.workspace = true | ||
license.workspace = true | ||
readme.workspace = true | ||
repository.workspace = true | ||
rust-version.workspace = true | ||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
3 changes: 3 additions & 0 deletions
3
tests/testsuite/init/inherit_workspace_package_table/out/crates/foo/src/main.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
println!("Check that our file is not overwritten") | ||
} |
14 changes: 14 additions & 0 deletions
14
tests/testsuite/init/inherit_workspace_package_table/out/src/lib.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
tests/testsuite/init/inherit_workspace_package_table/stderr.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Created binary (application) package |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters