From d153526037312f8b98d34491b6a8672169181721 Mon Sep 17 00:00:00 2001 From: Angelo Fallaria Date: Thu, 3 Feb 2022 11:57:28 +0800 Subject: [PATCH] test: improve test for nonexistent file --- src/config.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/config.rs b/src/config.rs index 7988336..a57b4ab 100644 --- a/src/config.rs +++ b/src/config.rs @@ -178,6 +178,15 @@ mod tests { let parse_result = parse_config(path); assert!(parse_result.is_err()); + + match parse_result.unwrap_err() { + Error::ConfigNotFound => { + return; + }, + _ => { + panic!("Error type for nonexistent file is wrong."); + } + } } #[test]