use cuvs::version::version;
#[test]
fn linked_library_version_is_compatible_with_crate() {
let (library_major, library_minor, library_patch) =
version().expect("the linked cuVS library should report its version");
let (crate_major, crate_minor, crate_patch) = (
env!("CARGO_PKG_VERSION_MAJOR").parse::<u16>().unwrap(),
env!("CARGO_PKG_VERSION_MINOR").parse::<u16>().unwrap(),
env!("CARGO_PKG_VERSION_PATCH").parse::<u16>().unwrap(),
);
assert_eq!(
(library_major, library_minor),
(crate_major, crate_minor),
"the linked cuVS library must have the same major and minor version as the crate"
);
assert!(
library_patch >= crate_patch,
"the linked cuVS library patch version must not be older than the crate"
);
}