Skip to content

Commit 91f6617

Browse files
committed
Add test
1 parent c4e150b commit 91f6617

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/testsuite/bad_config.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,36 @@ This will be considered an error in future versions
861861
.run();
862862
}
863863

864+
#[cargo_test]
865+
fn fragment_in_git_url() {
866+
let p = project()
867+
.file(
868+
"Cargo.toml",
869+
r#"
870+
[package]
871+
name = "foo"
872+
version = "0.0.0"
873+
authors = []
874+
875+
[dependencies.bar]
876+
git = "http://127.0.0.1#foo"
877+
"#,
878+
)
879+
.file("src/lib.rs", "")
880+
.build();
881+
882+
p.cargo("build -v")
883+
.with_status(101)
884+
.with_stderr_contains(
885+
"\
886+
[WARNING] URL fragment `#foo` in git URL is ignored for dependency (bar). \
887+
If you were trying to specify a specific git revision, \
888+
use `rev = \"foo\"` in the dependency declaration.
889+
",
890+
)
891+
.run();
892+
}
893+
864894
#[cargo_test]
865895
fn bad_source_config1() {
866896
let p = project()

0 commit comments

Comments
 (0)