add test for wrong_case in registry

This commit is contained in:
Eh2406 2018-07-10 11:05:44 -04:00
parent 3fafca1742
commit 8a717d32db
2 changed files with 42 additions and 2 deletions

View file

@ -161,7 +161,7 @@ fn wrong_case() {
.file("src/main.rs", "fn main() {}")
.build();
// TODO: #5678 to make this work or fleas give better error message
// TODO: #5678 to make this work or at least give better error message
assert_that(
p.cargo("build"),
execs().with_status(101).with_stderr(
@ -195,7 +195,7 @@ fn mis_hyphenated() {
.file("src/main.rs", "fn main() {}")
.build();
// TODO: #2775 to make this work or fleas give better error message
// TODO: #2775 to make this work or at least give better error message
assert_that(
p.cargo("build"),
execs().with_status(101).with_stderr(

View file

@ -440,6 +440,46 @@ fn resolving_incompat_versions() {
);
}
#[test]
fn resolving_wrong_case_from_registry() {
// In the future we may #5678 allow this to happen.
// For back compatibility reasons, we probably won't.
// But we may want to future prove ourselves by understanding it.
// This test documents the current behavior.
let reg = registry(vec![
pkg!(("foo", "1.0.0")),
pkg!("bar" => ["Foo"]),
]);
assert!(
resolve(
&pkg_id("root"),
vec![dep("bar")],
&reg
).is_err()
);
}
#[test]
fn resolving_mis_hyphenated_from_registry() {
// In the future we may #2775 allow this to happen.
// For back compatibility reasons, we probably won't.
// But we may want to future prove ourselves by understanding it.
// This test documents the current behavior.
let reg = registry(vec![
pkg!(("fo-o", "1.0.0")),
pkg!("bar" => ["fo_o"]),
]);
assert!(
resolve(
&pkg_id("root"),
vec![dep("bar")],
&reg
).is_err()
);
}
#[test]
fn resolving_backtrack() {
let reg = registry(vec![