mirror of
https://github.com/astral-sh/uv
synced 2026-01-24 06:50:18 -05:00
chore: Move all integration tests to a single binary (#8093)
As per https://matklad.github.io/2021/02/27/delete-cargo-integration-tests.html Before that, there were 91 separate integration tests binary. (As discussed on Discord — I've done the `uv` crate, there's still a few more commits coming before this is mergeable, and I want to see how it performs in CI and locally).
This commit is contained in:
32
crates/uv-python/src/python_version/tests.rs
Normal file
32
crates/uv-python/src/python_version/tests.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
use std::str::FromStr;
|
||||
|
||||
use uv_pep440::{Prerelease, PrereleaseKind, Version};
|
||||
|
||||
use crate::PythonVersion;
|
||||
|
||||
#[test]
|
||||
fn python_markers() {
|
||||
let version = PythonVersion::from_str("3.11.0").expect("valid python version");
|
||||
assert_eq!(version.python_version(), Version::new([3, 11]));
|
||||
assert_eq!(version.python_version().to_string(), "3.11");
|
||||
assert_eq!(version.python_full_version(), Version::new([3, 11, 0]));
|
||||
assert_eq!(version.python_full_version().to_string(), "3.11.0");
|
||||
|
||||
let version = PythonVersion::from_str("3.11").expect("valid python version");
|
||||
assert_eq!(version.python_version(), Version::new([3, 11]));
|
||||
assert_eq!(version.python_version().to_string(), "3.11");
|
||||
assert_eq!(version.python_full_version(), Version::new([3, 11, 0]));
|
||||
assert_eq!(version.python_full_version().to_string(), "3.11.0");
|
||||
|
||||
let version = PythonVersion::from_str("3.11.8a1").expect("valid python version");
|
||||
assert_eq!(version.python_version(), Version::new([3, 11]));
|
||||
assert_eq!(version.python_version().to_string(), "3.11");
|
||||
assert_eq!(
|
||||
version.python_full_version(),
|
||||
Version::new([3, 11, 8]).with_pre(Some(Prerelease {
|
||||
kind: PrereleaseKind::Alpha,
|
||||
number: 1
|
||||
}))
|
||||
);
|
||||
assert_eq!(version.python_full_version().to_string(), "3.11.8a1");
|
||||
}
|
||||
Reference in New Issue
Block a user