Skip to content

Commit 4d4ecdd

Browse files
committed
Add crate version tests
1 parent c697b55 commit 4d4ecdd

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tox/src/lib.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,26 @@ pub fn crate_version_minor() -> u32 {
1717
pub fn crate_version_patch() -> u32 {
1818
env!("CARGO_PKG_VERSION_PATCH").parse().expect("Invalid patch version")
1919
}
20+
21+
#[cfg(test)]
22+
mod tests {
23+
#[test]
24+
fn crate_version_is_not_empty() {
25+
assert_ne!(crate::crate_version(), "");
26+
}
27+
28+
#[test]
29+
fn crate_version_major() {
30+
crate::crate_version_major();
31+
}
32+
33+
#[test]
34+
fn crate_version_minor() {
35+
crate::crate_version_minor();
36+
}
37+
38+
#[test]
39+
fn crate_version_patch() {
40+
crate::crate_version_patch();
41+
}
42+
}

0 commit comments

Comments
 (0)