Skip to content

Commit

Permalink
Fix lint errors with Rust 1.73 (again) (#679)
Browse files Browse the repository at this point in the history
  • Loading branch information
edmorley authored Sep 21, 2023
1 parent 0e1caa7 commit 89bbc63
Showing 1 changed file with 22 additions and 22 deletions.
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

0 comments on commit 89bbc63

Please sign in to comment.