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,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: {}",