Skip to content

Commit 87f00a3

Browse files
committed
fix failing test
1 parent 03d97e4 commit 87f00a3

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

tests/testsuite/patch.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,14 @@ fn patch_to_git() {
360360
#[cargo_test]
361361
fn patch_to_git_pull_request() {
362362
Package::new("bar", "0.1.0").publish();
363+
let traiter = if cargo_test_support::git::cargo_uses_gitoxide() {
364+
r#" An IO error occurred when talking to the server
365+
366+
Caused by:
367+
Received HTTP status 404"#
368+
} else {
369+
r#" unexpected http status code: 404; class=Http (34)"#
370+
};
363371

364372
let p = project()
365373
.file(
@@ -386,12 +394,10 @@ fn patch_to_git_pull_request() {
386394

387395
p.cargo("check -v")
388396
.with_status(101)
389-
.with_stderr_data(str![[r#"
390-
[WARNING] dependency (bar) git url https://github.com/foo/bar/pull/123 is not a repository. The path looks like a pull request. Try replacing the dependency with: `git = "https://github.com/foo/bar.git" rev = "refs/pull/123/head"` in the dependency declaration.
397+
.with_stderr_data(format!(
398+
r#"[WARNING] dependency (bar) git url https://github.com/foo/bar/pull/123 is not a repository. The path looks like a pull request. Try replacing the dependency with: `git = "https://github.com/foo/bar.git" rev = "refs/pull/123/head"` in the dependency declaration.
391399
[UPDATING] git repository `https://github.com/foo/bar/pull/123`
392-
[WARNING] spurious network error (3 tries remaining): unexpected http status code: 404; class=Http (34)
393-
[WARNING] spurious network error (2 tries remaining): unexpected http status code: 404; class=Http (34)
394-
[WARNING] spurious network error (1 tries remaining): unexpected http status code: 404; class=Http (34)
400+
...
395401
[ERROR] failed to load source for dependency `bar`
396402
397403
Caused by:
@@ -406,9 +412,8 @@ Caused by:
406412
https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli
407413
408414
Caused by:
409-
unexpected http status code: 404; class=Http (34)
410-
411-
"#]])
415+
{traiter}
416+
"#))
412417
.run();
413418
}
414419

0 commit comments

Comments
 (0)