Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint errors with Rust 1.73 (again) #679

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions libcnb-test/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,20 @@ fn rebuild() {
#[test]
#[ignore = "integration test"]
fn buildpack_packaging_failure() {
let result = std::panic::catch_unwind(|| {
let err = std::panic::catch_unwind(|| {
TestRunner::default().build(BuildConfig::new("invalid!", "test-fixtures/empty"), |_| {
unreachable!("The test should panic prior to the TestContext being invoked.");
});
});
match result {
Ok(_) => panic!("expected a failure"),
Err(error) => {
assert_eq!(
error.downcast_ref::<String>().unwrap().to_string(),
format!("Could not package directory as buildpack! No `buildpack.toml` file exists at {}", env::var("CARGO_MANIFEST_DIR").unwrap())
);
}
}
})
.unwrap_err();

assert_eq!(
err.downcast_ref::<String>().unwrap().to_string(),
format!(
"Could not package directory as buildpack! No `buildpack.toml` file exists at {}",
env::var("CARGO_MANIFEST_DIR").unwrap()
)
);
}

#[test]
Expand Down Expand Up @@ -141,24 +141,24 @@ fn expected_pack_failure() {
#[test]
#[ignore = "integration test"]
fn expected_pack_failure_still_panics_for_non_pack_failure() {
let result = std::panic::catch_unwind(|| {
let err = std::panic::catch_unwind(|| {
TestRunner::default().build(
BuildConfig::new("invalid!", "test-fixtures/empty")
.expected_pack_result(PackResult::Failure),
|_| {
unreachable!("The test should panic prior to the TestContext being invoked.");
},
);
});
match result {
Ok(_) => panic!("expected a failure"),
Err(error) => {
assert_eq!(
error.downcast_ref::<String>().unwrap().to_string(),
format!("Could not package directory as buildpack! No `buildpack.toml` file exists at {}", env::var("CARGO_MANIFEST_DIR").unwrap())
);
}
}
})
.unwrap_err();

assert_eq!(
err.downcast_ref::<String>().unwrap().to_string(),
format!(
"Could not package directory as buildpack! No `buildpack.toml` file exists at {}",
env::var("CARGO_MANIFEST_DIR").unwrap()
)
);
}

#[test]
Expand Down