From e687e27a5b6bfc771cef0bebf6aa01ff1dfd33c3 Mon Sep 17 00:00:00 2001 From: Nathan Fisher Date: Fri, 5 Jan 2024 11:46:50 -0500 Subject: [PATCH] Add test for equality for PreRelease::Alpha TODO: Fix failing test.. --- src/prerelease.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/prerelease.rs b/src/prerelease.rs index 76d5f2e..9848b1b 100644 --- a/src/prerelease.rs +++ b/src/prerelease.rs @@ -207,4 +207,15 @@ mod tests { assert_eq!("Rc".parse::().unwrap(), PreRelease::RC(None)); assert_eq!("RC".parse::().unwrap(), PreRelease::RC(None)); } + + #[test] + fn equality() { + let a: u16 = PreRelease::Alpha(None).into(); + let b: u16 = PreRelease::Alpha(Some(NonZeroU16::new(1).unwrap())).into(); + assert_eq!(a, b); + assert_eq!( + PreRelease::Alpha(None), + PreRelease::Alpha(Some(NonZeroU16::new(1).unwrap())), + ); + } }