diff options
Diffstat (limited to 'vendor/semver/tests/util')
-rw-r--r-- | vendor/semver/tests/util/mod.rs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/vendor/semver/tests/util/mod.rs b/vendor/semver/tests/util/mod.rs index 5cc142c48..07d691fab 100644 --- a/vendor/semver/tests/util/mod.rs +++ b/vendor/semver/tests/util/mod.rs @@ -1,6 +1,6 @@ #![allow(dead_code)] -use semver::{BuildMetadata, Error, Prerelease, Version, VersionReq}; +use semver::{BuildMetadata, Comparator, Error, Prerelease, Version, VersionReq}; use std::fmt::Display; #[cfg_attr(not(no_track_caller), track_caller)] @@ -24,11 +24,26 @@ pub(super) fn req_err(text: &str) -> Error { } #[cfg_attr(not(no_track_caller), track_caller)] +pub(super) fn comparator(text: &str) -> Comparator { + Comparator::parse(text).unwrap() +} + +#[cfg_attr(not(no_track_caller), track_caller)] +pub(super) fn comparator_err(text: &str) -> Error { + Comparator::parse(text).unwrap_err() +} + +#[cfg_attr(not(no_track_caller), track_caller)] pub(super) fn prerelease(text: &str) -> Prerelease { Prerelease::new(text).unwrap() } #[cfg_attr(not(no_track_caller), track_caller)] +pub(super) fn prerelease_err(text: &str) -> Error { + Prerelease::new(text).unwrap_err() +} + +#[cfg_attr(not(no_track_caller), track_caller)] pub(super) fn build_metadata(text: &str) -> BuildMetadata { BuildMetadata::new(text).unwrap() } |