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
This commit is contained in:
Alex Wied 2022-08-11 07:50:32 +00:00
parent 4fc0cb121c
commit e0f86588e6

View File

@ -37,7 +37,8 @@ mod test {
#[test] #[test]
fn version_formatting() { fn version_formatting() {
let re = Regex::new(r"^Lighthouse/v[0-9]+\.[0-9]+\.[0-9]+(-rc.[0-9])?-[[:xdigit:]]{7}\+?$") let re =
Regex::new(r"^Lighthouse/v[0-9]+\.[0-9]+\.[0-9]+(-rc.[0-9])?(-[[:xdigit:]]{7})?\+?$")
.unwrap(); .unwrap();
assert!( assert!(
re.is_match(VERSION), re.is_match(VERSION),