Skip to content

Commit 2488ad9

Browse files
committed
Fix panics not shown in gix-url baseline generation
Forcing the lazy value ensures the baseline is generated before we overwrite the panic hook. Previously any errors thrown during baseline generation were not shown in the error output because the panic message was hidden by our overwritten panic hook.
1 parent a530037 commit 2488ad9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gix-url/tests/baseline.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::any::Any;
22

33
use bstr::ByteSlice;
4+
use gix_testtools::once_cell::sync::Lazy;
45

56
/// To see all current failures run the following command or execute cargo-nextest directly with
67
/// the below shown arguments.
@@ -10,6 +11,10 @@ use bstr::ByteSlice;
1011
/// ``
1112
#[test]
1213
fn run() {
14+
// ensure the baseline is evaluated before we disable the panic hook, otherwise we swallow
15+
// errors inside the baseline generation
16+
Lazy::force(&baseline::URLS);
17+
1318
let panic_hook = std::panic::take_hook();
1419
std::panic::set_hook(Box::new(|_| {}));
1520

0 commit comments

Comments
 (0)