You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2026/08/04 11:47:06 UTC
(commons-lang) 04/05: Parameterize ConversionTest.testHexDigitToIntIllegalArgumentException(char)
This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit af1b18e2479b841669b659b89e71f948e229cef0
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Aug 4 07:40:17 2026 -0400
Parameterize
ConversionTest.testHexDigitToIntIllegalArgumentException(char)
---
.../org/apache/commons/lang3/ConversionTest.java | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/src/test/java/org/apache/commons/lang3/ConversionTest.java b/src/test/java/org/apache/commons/lang3/ConversionTest.java
index ffdf1e24f..feee7af82 100644
--- a/src/test/java/org/apache/commons/lang3/ConversionTest.java
+++ b/src/test/java/org/apache/commons/lang3/ConversionTest.java
@@ -692,14 +692,19 @@ void testHexDigitToInt() {
/**
* Tests {@link Conversion#hexDigitToInt(char)}.
*/
- @Test
- void testHexDigitToIntIllegalArgumentException() {
- assertIllegalArgumentException(() -> Conversion.hexDigitToInt('G'));
- assertIllegalArgumentException(() -> Conversion.hexDigitToInt('\uFF41')); // FULLWIDTH LATIN SMALL LETTER A
- assertIllegalArgumentException(() -> Conversion.hexDigitToInt('\uFF26')); // FULLWIDTH LATIN CAPITAL LETTER F
- assertIllegalArgumentException(() -> Conversion.hexDigitToInt('\uFF19')); // FULLWIDTH DIGIT NINE
- assertIllegalArgumentException(() -> Conversion.hexDigitToInt('\u0669')); // ARABIC-INDIC DIGIT NINE
- assertIllegalArgumentException(() -> Conversion.hexDigitToInt('\u096B')); // DEVANAGARI DIGIT FIVE
+ @ParameterizedTest
+ // @formatter:off
+ @ValueSource(chars = {
+ 'G',
+ '\uFF41', // FULLWIDTH LATIN SMALL LETTER A
+ '\uFF26', // FULLWIDTH LATIN CAPITAL LETTER F
+ '\uFF19', // FULLWIDTH DIGIT NINE
+ '\u0669', // ARABIC-INDIC DIGIT NINE
+ '\u096B' // DEVANAGARI DIGIT FIVE
+ })
+ // @formatter:on
+ void testHexDigitToIntIllegalArgumentException(final char ch) {
+ assertIllegalArgumentException(() -> Conversion.hexDigitToInt(ch));
}
/**