mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-25 11:14:46 +00:00
Add test for bad renaming
This commit is contained in:
parent
420608bc70
commit
fcff51b3e0
@ -911,6 +911,37 @@ required by package `foo v0.0.1 ([CWD])`
|
||||
.run();
|
||||
}
|
||||
|
||||
// Ensure that renamed deps have a valid name
|
||||
#[cargo_test]
|
||||
fn cargo_compile_with_invalid_dep_rename() {
|
||||
let p = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "buggin"
|
||||
version = "0.1.0"
|
||||
|
||||
[dependencies]
|
||||
"haha this isn't a valid name 🐛" = { package = "libc", version = "0.1" }
|
||||
"#,
|
||||
)
|
||||
.file("src/main.rs", &main_file(r#""What's good?""#, &[]))
|
||||
.build();
|
||||
|
||||
p.cargo("build")
|
||||
.with_status(101)
|
||||
.with_stderr(
|
||||
"\
|
||||
error: failed to parse manifest at `[..]`
|
||||
|
||||
Caused by:
|
||||
invalid character ` ` in dependency name: `haha this isn't a valid name 🐛`, characters must be Unicode XID characters (numbers, `-`, `_`, or most letters)
|
||||
",
|
||||
)
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn cargo_compile_with_filename() {
|
||||
let p = project()
|
||||
|
Loading…
x
Reference in New Issue
Block a user