diff options
Diffstat (limited to 'src/libcore/tests')
| -rw-r--r-- | src/libcore/tests/nonzero.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libcore/tests/nonzero.rs b/src/libcore/tests/nonzero.rs index 8d39298bac3..bbb1ef76bcc 100644 --- a/src/libcore/tests/nonzero.rs +++ b/src/libcore/tests/nonzero.rs @@ -121,3 +121,10 @@ fn test_match_nonzero_const_pattern() { _ => panic!("Expected the const item as a pattern to match.") } } + +#[test] +fn test_from_nonzero() { + let nz = NonZeroU32::new(1).unwrap(); + let num: u32 = nz.into(); + assert_eq!(num, 1u32); +} |
