This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
The following commit(s) were added to refs/heads/master by this push:
new 36e740ceb Add NumberUtils.isParsable(String) assertions
36e740ceb is described below
commit 36e740cebeb947aae7721accaff0b1aaba846926
Author: Gary Gregory <[email protected]>
AuthorDate: Wed Dec 17 11:25:31 2025 -0500
Add NumberUtils.isParsable(String) assertions
---
.../java/org/apache/commons/lang3/math/NumberUtilsTest.java | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
b/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
index 17ee88bc8..9af9b014c 100644
--- a/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
@@ -1013,7 +1013,9 @@ void testIsParsable() {
assertFalse(NumberUtils.isParsable("pendro"));
assertFalse(NumberUtils.isParsable("64, 2"));
assertFalse(NumberUtils.isParsable("64.2.2"));
+ assertFalse(NumberUtils.isParsable("64.."));
assertTrue(NumberUtils.isParsable("64."));
+ assertTrue(NumberUtils.isParsable("-64."));
assertFalse(NumberUtils.isParsable("64L"));
assertFalse(NumberUtils.isParsable("-"));
assertFalse(NumberUtils.isParsable("--2"));
@@ -1026,6 +1028,8 @@ void testIsParsable() {
assertTrue(NumberUtils.isParsable("-018.2"));
assertTrue(NumberUtils.isParsable("-.236"));
assertTrue(NumberUtils.isParsable("2."));
+ // TODO assertTrue(NumberUtils.isParsable("2.f"));
+ // TODO assertTrue(NumberUtils.isParsable("2.d"));
}
/**
@@ -1078,6 +1082,9 @@ void testLang1729IsParsableByte() {
@Test
void testLang1729IsParsableDouble() {
assertTrue(isParsableDouble("1"));
+ assertTrue(isParsableDouble("1."));
+ // TODO assertTrue(isParsableDouble("1.f"));
+ // TODO assertTrue(isParsableDouble("1.d"));
assertTrue(isParsableDouble("1.0"));
assertFalse(isParsableDouble("1.0."));
assertFalse(isParsableDouble("1 2 3"));
@@ -1087,6 +1094,9 @@ void testLang1729IsParsableDouble() {
@Test
void testLang1729IsParsableFloat() {
assertTrue(isParsableFloat("1"));
+ assertTrue(isParsableFloat("1."));
+ // TODO assertTrue(isParsableFloat("1.f"));
+ // TODO assertTrue(isParsableFloat("1.d"));
assertTrue(isParsableFloat("1.0"));
assertFalse(isParsableFloat("1.0."));
assertFalse(isParsableFloat("1 2 3"));