Skip to content

Commit

Permalink
Add VersionRequest test cases for post and dev segments
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Sep 17, 2024
1 parent bb0ffa3 commit 6c06181
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions crates/uv-python/src/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down

0 comments on commit 6c06181

Please sign in to comment.