Add VersionRequest test cases for post and dev segments (#7464)

This commit is contained in:
Zanie Blue 2024-09-17 10:59:41 -05:00 committed by GitHub
parent 778da3350a
commit 8d7925026d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2316,6 +2316,20 @@ mod tests {
),
"Pre-release version requests require a patch version of zero"
);
assert!(
matches!(
VersionRequest::from_str("3.12-dev"),
Err(Error::InvalidVersionRequest(_))
),
"Development version segments are not allowed"
);
assert!(
matches!(
VersionRequest::from_str("3.12.post0"),
Err(Error::InvalidVersionRequest(_))
),
"Post version segments are not allowed"
);
assert!(
// Test for overflow
matches!(