Skip to content

Commit 87345a1

Browse files
committed
test: correct not_inherit_workspace_package_table_if_not_members case
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
1 parent 13e9792 commit 87345a1

File tree

6 files changed

+25
-7
lines changed

6 files changed

+25
-7
lines changed

tests/testsuite/cargo_new/not_inherit_workspace_package_table_if_not_members/in/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[workspace]
2+
exclude = ["bar"]
13
[workspace.package]
24
authors = ["Rustaceans"]
35
description = "foo"
@@ -13,3 +15,8 @@ include = ["foo"]
1315
license = "MIT OR Apache-2.0"
1416
publish = false
1517
repository = "foo"
18+
19+
[package]
20+
name = "foo"
21+
version = "0.1.0"
22+
edition = "2018"

tests/testsuite/cargo_new/not_inherit_workspace_package_table_if_not_members/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fn case() {
1111

1212
snapbox::cmd::Command::cargo_ui()
1313
.arg("new")
14-
.args(["foo"])
14+
.args(["bar"])
1515
.current_dir(cwd)
1616
.assert()
1717
.success()

tests/testsuite/cargo_new/not_inherit_workspace_package_table_if_not_members/out/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace]
2-
members = ["foo"]
2+
exclude = ["bar"]
33
[workspace.package]
44
authors = ["Rustaceans"]
55
description = "foo"
@@ -15,3 +15,8 @@ include = ["foo"]
1515
license = "MIT OR Apache-2.0"
1616
publish = false
1717
repository = "foo"
18+
19+
[package]
20+
name = "foo"
21+
version = "0.1.0"
22+
edition = "2018"

tests/testsuite/cargo_new/not_inherit_workspace_package_table_if_not_members/out/foo/Cargo.toml renamed to tests/testsuite/cargo_new/not_inherit_workspace_package_table_if_not_members/out/bar/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "foo"
2+
name = "bar"
33
version = "0.1.0"
44
authors.workspace = true
55
description.workspace = true

tests/testsuite/cargo_new/not_inherit_workspace_package_table_if_not_members/out/foo/src/main.rs

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
Created binary (application) `foo` package
1+
warning: compiling this new package may not work due to invalid workspace configuration
2+
3+
failed to parse manifest at `[ROOT]/case/bar/Cargo.toml`
4+
5+
Caused by:
6+
error inheriting `edition` from workspace root manifest's `workspace.package.edition`
7+
8+
Caused by:
9+
failed to find a workspace root
10+
Created binary (application) `bar` package

0 commit comments

Comments
 (0)