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())), + ); + } }