aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / vendor / semver / tests / util / mod.rs
| 1 | #![allow(dead_code)] |
| 2 | |
| 3 | use semver::{BuildMetadata, Comparator, Error, Prerelease, Version, VersionReq}; |
| 4 | use std::fmt::Display; |
| 5 | |
| 6 | #[track_caller] |
| 7 | pub(super) fn version(text: &str) -> Version { |
| 8 | Version::parse(text).unwrap() |
| 9 | } |
| 10 | |
| 11 | #[track_caller] |
| 12 | pub(super) fn version_err(text: &str) -> Error { |
| 13 | Version::parse(text).unwrap_err() |
| 14 | } |
| 15 | |
| 16 | #[track_caller] |
| 17 | pub(super) fn req(text: &str) -> VersionReq { |
| 18 | VersionReq::parse(text).unwrap() |
| 19 | } |
| 20 | |
| 21 | #[track_caller] |
| 22 | pub(super) fn req_err(text: &str) -> Error { |
| 23 | VersionReq::parse(text).unwrap_err() |
| 24 | } |
| 25 | |
| 26 | #[track_caller] |
| 27 | pub(super) fn comparator(text: &str) -> Comparator { |
| 28 | Comparator::parse(text).unwrap() |
| 29 | } |
| 30 | |
| 31 | #[track_caller] |
| 32 | pub(super) fn comparator_err(text: &str) -> Error { |
| 33 | Comparator::parse(text).unwrap_err() |
| 34 | } |
| 35 | |
| 36 | #[track_caller] |
| 37 | pub(super) fn prerelease(text: &str) -> Prerelease { |
| 38 | Prerelease::new(text).unwrap() |
| 39 | } |
| 40 | |
| 41 | #[track_caller] |
| 42 | pub(super) fn prerelease_err(text: &str) -> Error { |
| 43 | Prerelease::new(text).unwrap_err() |
| 44 | } |
| 45 | |
| 46 | #[track_caller] |
| 47 | pub(super) fn build_metadata(text: &str) -> BuildMetadata { |
| 48 | BuildMetadata::new(text).unwrap() |
| 49 | } |
| 50 | |
| 51 | #[track_caller] |
| 52 | pub(super) fn assert_to_string(value: impl Display, expected: &str) { |
| 53 | assert_eq!(value.to_string(), expected); |
| 54 | } |