Skip to content

Commit 47f497d

Browse files
committed
Add explicit tests for from_str_radix with negative inputs to unsigned destinations and for inputs with underscores in them
1 parent 06322b8 commit 47f497d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/core/tests/num/int_macros.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ macro_rules! int_module {
246246

247247
assert_eq!($T::from_str_radix("Z", 35).ok(), None::<$T>);
248248
assert_eq!($T::from_str_radix("-9", 2).ok(), None::<$T>);
249+
assert_eq!($T::from_str_radix("10_0", 10).ok(), None::<$T>);
250+
assert_eq!(u32::from_str_radix("-9", 10).ok(), None::<$T>);
249251
}
250252

251253
#[test]

0 commit comments

Comments
 (0)