diff options
| author | Marcel Hellwig <git@cookiesoft.de> | 2019-02-27 18:37:35 +0100 |
|---|---|---|
| committer | Marcel Hellwig <git@cookiesoft.de> | 2019-02-27 18:37:35 +0100 |
| commit | ce30d4e1b947f8580636909c4c6f5aaeb254ea4c (patch) | |
| tree | 4b34df1ceec806f55745d09c7b641fd8bd60dfaa /src/libcore/tests | |
| parent | 36bcbc352d4b48f0f3aea35fd9ca74e856f797c9 (diff) | |
| download | rust-ce30d4e1b947f8580636909c4c6f5aaeb254ea4c.tar.gz rust-ce30d4e1b947f8580636909c4c6f5aaeb254ea4c.zip | |
replaced nonzeroparseerror with regular interror
Diffstat (limited to 'src/libcore/tests')
| -rw-r--r-- | src/libcore/tests/nonzero.rs | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/libcore/tests/nonzero.rs b/src/libcore/tests/nonzero.rs index 6e2d4588edc..764b0c249f9 100644 --- a/src/libcore/tests/nonzero.rs +++ b/src/libcore/tests/nonzero.rs @@ -129,17 +129,23 @@ fn test_from_signed_nonzero() { #[test] fn test_from_str() { - assert_eq!(FromStr::from_str("123"), Ok(NonZeroU8::new(123).unwrap())); + assert_eq!("123".parse::<NonZeroU8>(), Ok(NonZeroU8::new(123).unwrap())); assert_eq!( - FromStr::from_str("0"), - Err(ParseNonZeroIntError { - kind: NonZeroIntErrorKind::Zero + "0".parse::<NonZeroU8>(), + Err(ParseIntError { + kind: IntErrorKind::Zero }) ); assert_eq!( - FromStr::from_str("-1", - Err(ParseNonZeroIntError { - kind: NonZeroIntErrorKind::Underflow + "-1".parse::<NonZeroU8>(), + Err(ParseIntError { + kind: IntErrorKind::Underflow + }) + ); + assert_eq!( + "129".parse::<NonZeroU8>(), + Err(ParseIntError { + kind: IntErrorKind::Overflow }) ); } |
