From e0f86588e634c186c0ab493694a8e4804fcbbf93 Mon Sep 17 00:00:00 2001 From: Alex Wied Date: Thu, 11 Aug 2022 07:50:32 +0000 Subject: [PATCH] lighthouse_version: Fix version string regex (#3451) ## Issue Addressed N/A ## Proposed Changes If the build tree is not a git repository, the unit test will fail. This PR fixes the issue. ## Additional Info N/A --- common/lighthouse_version/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/lighthouse_version/src/lib.rs b/common/lighthouse_version/src/lib.rs index f5d4d44878..c499bf0498 100644 --- a/common/lighthouse_version/src/lib.rs +++ b/common/lighthouse_version/src/lib.rs @@ -37,8 +37,9 @@ mod test { #[test] fn version_formatting() { - let re = Regex::new(r"^Lighthouse/v[0-9]+\.[0-9]+\.[0-9]+(-rc.[0-9])?-[[:xdigit:]]{7}\+?$") - .unwrap(); + let re = + Regex::new(r"^Lighthouse/v[0-9]+\.[0-9]+\.[0-9]+(-rc.[0-9])?(-[[:xdigit:]]{7})?\+?$") + .unwrap(); assert!( re.is_match(VERSION), "version doesn't match regex: {}",