test(package): Show behavior with capitalized member

This commit is contained in:
Ed Page 2025-02-21 08:23:18 -06:00
parent fcaf5964d7
commit 258db04176

View File

@ -6430,6 +6430,74 @@ fn workspace_with_local_and_remote_deps() {
.run();
}
#[cargo_test]
fn workspace_with_capitalized_member() {
let reg = registry::init();
let p = project()
.file(
"Cargo.toml",
r#"
[workspace]
members = ["dep", "main"]
"#,
)
.file(
"main/Cargo.toml",
r#"
[package]
name = "main"
version = "0.0.1"
edition = "2015"
authors = []
license = "MIT"
description = "main"
repository = "bar"
[dependencies]
DEP = { path = "../dep", version = "0.1.0" }
"#,
)
.file("main/src/main.rs", "fn main() {}")
.file(
"dep/Cargo.toml",
r#"
[package]
name = "DEP"
version = "0.1.0"
edition = "2015"
authors = []
license = "MIT"
description = "dep"
repository = "bar"
"#,
)
.file("dep/src/lib.rs", "")
.build();
p.cargo("package -Zpackage-workspace --no-verify")
.masquerade_as_nightly_cargo(&["package-workspace"])
.replace_crates_io(reg.index_url())
.with_status(101)
.with_stderr_data(
str![[r#"
[PACKAGING] main v0.0.1 ([ROOT]/foo/main)
[UPDATING] crates.io index
[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
[PACKAGING] DEP v0.1.0 ([ROOT]/foo/dep)
[ERROR] failed to prepare local package for uploading
Caused by:
no matching package named `DEP` found
location searched: crates.io index
required by package `main v0.0.1 ([ROOT]/foo/main)`
"#]]
.unordered(),
)
.run();
}
#[cargo_test]
fn registry_not_in_publish_list() {
let p = project()