Skip to content

Commit ade33c2

Browse files
committed
teset(pkgid): suggestion for bad parsing
1 parent a22b3ac commit ade33c2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/testsuite/pkgid.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ fn suggestion_bad_pkgid() {
5454
"#,
5555
)
5656
.file("src/lib.rs", "")
57+
.file("cratesio", "")
5758
.build();
5859

5960
p.cargo("generate-lockfile").run();
@@ -106,6 +107,21 @@ error: invalid package ID specification: `./Cargo.toml`
106107
107108
Caused by:
108109
package ID specification `./Cargo.toml` looks like a file path, maybe try file://[..]/Cargo.toml
110+
",
111+
)
112+
.run();
113+
114+
// Bad file URL with simliar name.
115+
p.cargo("pkgid './cratesio'")
116+
.with_status(101)
117+
.with_stderr(
118+
"\
119+
error: invalid package ID specification: `./cratesio`
120+
121+
<tab>Did you mean `crates-io`?
122+
123+
Caused by:
124+
package ID specification `./cratesio` looks like a file path, maybe try file://[..]/cratesio
109125
",
110126
)
111127
.run();

0 commit comments

Comments
 (0)