Skip to content

Commit

Permalink
Add crate version tests
Browse files Browse the repository at this point in the history
  • Loading branch information
antis81 committed Nov 23, 2023
1 parent c697b55 commit 4d4ecdd
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tox/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,26 @@ pub fn crate_version_minor() -> u32 {
pub fn crate_version_patch() -> u32 {
env!("CARGO_PKG_VERSION_PATCH").parse().expect("Invalid patch version")
}

#[cfg(test)]
mod tests {
#[test]
fn crate_version_is_not_empty() {
assert_ne!(crate::crate_version(), "");
}

#[test]
fn crate_version_major() {
crate::crate_version_major();
}

#[test]
fn crate_version_minor() {
crate::crate_version_minor();
}

#[test]
fn crate_version_patch() {
crate::crate_version_patch();
}
}

0 comments on commit 4d4ecdd

Please sign in to comment.