From 04945fe065f271e1c8855be499d10df55b7a487b Mon Sep 17 00:00:00 2001 From: Mahesh Bandara Wijerathna Date: Sat, 20 Apr 2024 18:21:03 +0530 Subject: [PATCH] [config_util] Set the custom panic hook for tests with debug mode This is necessary to debug errors from panics since the tests might trigger "unwrap_or_quit()". --- backend/src/config_util.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/src/config_util.rs b/backend/src/config_util.rs index e5673fb..697ec36 100644 --- a/backend/src/config_util.rs +++ b/backend/src/config_util.rs @@ -205,10 +205,13 @@ pub async fn inc_file_number() { #[cfg(test)] mod tests { + use crate::rt_util::set_custom_panic; + use super::{get_config, is_debug, load_config, UFCRConfig}; #[tokio::test] async fn unit_load_config() { + set_custom_panic(true); load_config().await; }