From ed389b70e22f056549637573917a23adcb345733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Sun, 2 Apr 2023 23:50:38 +0300 Subject: [PATCH] refactor(test): handle errors for changelog module tests --- git-cliff-core/src/changelog.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/git-cliff-core/src/changelog.rs b/git-cliff-core/src/changelog.rs index 8e96401f75..c1702a2f54 100644 --- a/git-cliff-core/src/changelog.rs +++ b/git-cliff-core/src/changelog.rs @@ -209,7 +209,8 @@ mod test { filter_unconventional: Some(false), split_commits: Some(false), commit_preprocessors: Some(vec![CommitPreprocessor { - pattern: Regex::new("").unwrap(), + pattern: Regex::new("") + .expect("failed to compile regex"), replace: Some(String::from( "this commit is preprocessed", )), @@ -429,7 +430,7 @@ mod test { ------------"# ) .replace(" ", ""), - str::from_utf8(&out).unwrap() + str::from_utf8(&out).unwrap_or_default() ); Ok(()) } @@ -543,7 +544,7 @@ chore(deps): fix broken deps ------------"# ) .replace(" ", ""), - str::from_utf8(&out).unwrap() + str::from_utf8(&out).unwrap_or_default() ); Ok(()) }