about summary refs log tree commit diff
path: root/library
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-09-18 17:20:57 +0200
committerGitHub <noreply@github.com>2025-09-18 17:20:57 +0200
commitfd852f4bee1e8cc7a0d5a287f055b03192656571 (patch)
tree7bb382af081a856b92209064299bbe7247e7063e /library
parent185926c99f34985f1823b1f085ef6f446a5ee4f3 (diff)
parentafe8f81c73244bcc33be39c9ea0f90f090ac14ce (diff)
downloadrust-fd852f4bee1e8cc7a0d5a287f055b03192656571.tar.gz
rust-fd852f4bee1e8cc7a0d5a287f055b03192656571.zip
Rollup merge of #146487 - ferrocene:pvdrz/improve-num-coverage, r=joboet
Improve `core::num` coverage

This PR improves the `core::num` coverage by adding a new test to `coretests`.

r? libs
Diffstat (limited to 'library')
-rw-r--r--library/coretests/tests/num/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/library/coretests/tests/num/mod.rs b/library/coretests/tests/num/mod.rs
index 54e54f734f6..913f766ec16 100644
--- a/library/coretests/tests/num/mod.rs
+++ b/library/coretests/tests/num/mod.rs
@@ -112,6 +112,13 @@ fn from_str_issue7588() {
 }
 
 #[test]
+#[should_panic = "radix must lie in the range `[2, 36]`"]
+fn from_ascii_radix_panic() {
+    let radix = 1;
+    let _parsed = u64::from_str_radix("12345ABCD", radix);
+}
+
+#[test]
 fn test_int_from_str_overflow() {
     test_parse::<i8>("127", Ok(127));
     test_parse::<i8>("128", Err(IntErrorKind::PosOverflow));