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:
parent
4fc0cb121c
commit
e0f86588e6
@ -37,8 +37,9 @@ 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 =
|
||||||
.unwrap();
|
Regex::new(r"^Lighthouse/v[0-9]+\.[0-9]+\.[0-9]+(-rc.[0-9])?(-[[:xdigit:]]{7})?\+?$")
|
||||||
|
.unwrap();
|
||||||
assert!(
|
assert!(
|
||||||
re.is_match(VERSION),
|
re.is_match(VERSION),
|
||||||
"version doesn't match regex: {}",
|
"version doesn't match regex: {}",
|
||||||
|
Loading…
Reference in New Issue
Block a user