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 2025/10/10 10:45:15 UTC

(commons-lang) branch master updated: Fix typo in test assertion messages

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 5a5ced8ed Fix typo in test assertion messages
5a5ced8ed is described below

commit 5a5ced8ed67ed1e48865544c30539d51b690060b
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Fri Oct 10 06:45:09 2025 -0400

    Fix typo in test assertion messages
---
 .../org/apache/commons/lang3/StringUtilsTest.java  | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
index 148c46977..80ca70c6c 100644
--- a/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
@@ -2951,16 +2951,16 @@ void testToString() throws UnsupportedEncodingException {
     @Test
     void testTruncate_StringInt() {
         assertNull(StringUtils.truncate(null, 12));
-        assertIllegalArgumentException(() -> StringUtils.truncate(null, -1), "maxWith cannot be negative");
-        assertIllegalArgumentException(() -> StringUtils.truncate(null, -10), "maxWith cannot be negative");
-        assertIllegalArgumentException(() -> StringUtils.truncate(null, Integer.MIN_VALUE), "maxWith cannot be negative");
+        assertIllegalArgumentException(() -> StringUtils.truncate(null, -1), "maxWidth cannot be negative");
+        assertIllegalArgumentException(() -> StringUtils.truncate(null, -10), "maxWidth cannot be negative");
+        assertIllegalArgumentException(() -> StringUtils.truncate(null, Integer.MIN_VALUE), "maxWidth cannot be negative");
         assertEquals("", StringUtils.truncate("", 10));
         assertEquals("abc", StringUtils.truncate("abcdefghij", 3));
         assertEquals("abcdef", StringUtils.truncate("abcdefghij", 6));
         assertEquals("", StringUtils.truncate("abcdefghij", 0));
-        assertIllegalArgumentException(() -> StringUtils.truncate("abcdefghij", -1), "maxWith cannot be negative");
-        assertIllegalArgumentException(() -> StringUtils.truncate("abcdefghij", -100), "maxWith cannot be negative");
-        assertIllegalArgumentException(() -> StringUtils.truncate("abcdefghij", Integer.MIN_VALUE), "maxWith cannot be negative");
+        assertIllegalArgumentException(() -> StringUtils.truncate("abcdefghij", -1), "maxWidth cannot be negative");
+        assertIllegalArgumentException(() -> StringUtils.truncate("abcdefghij", -100), "maxWidth cannot be negative");
+        assertIllegalArgumentException(() -> StringUtils.truncate("abcdefghij", Integer.MIN_VALUE), "maxWidth cannot be negative");
         assertEquals("abcdefghij", StringUtils.truncate("abcdefghijklmno", 10));
         assertEquals("abcdefghijklmno", StringUtils.truncate("abcdefghijklmno", Integer.MAX_VALUE));
         assertEquals("abcde", StringUtils.truncate("abcdefghijklmno", 5));
@@ -2979,11 +2979,11 @@ void testTruncate_StringIntInt() {
         assertEquals("abc", StringUtils.truncate("abcdefghij", 0, 3));
         assertEquals("fghij", StringUtils.truncate("abcdefghij", 5, 6));
         assertEquals("", StringUtils.truncate("abcdefghij", 0, 0));
-        assertIllegalArgumentException(() -> StringUtils.truncate("abcdefghij", 0, -1), "maxWith cannot be negative");
-        assertIllegalArgumentException(() -> StringUtils.truncate("abcdefghij", 0, -10), "maxWith cannot be negative");
-        assertIllegalArgumentException(() -> StringUtils.truncate("abcdefghij", 0, -100), "maxWith cannot be negative");
-        assertIllegalArgumentException(() -> StringUtils.truncate("abcdefghij", 1, -100), "maxWith cannot be negative");
-        assertIllegalArgumentException(() -> StringUtils.truncate("abcdefghij", 0, Integer.MIN_VALUE), "maxWith cannot be negative");
+        assertIllegalArgumentException(() -> StringUtils.truncate("abcdefghij", 0, -1), "maxWidth cannot be negative");
+        assertIllegalArgumentException(() -> StringUtils.truncate("abcdefghij", 0, -10), "maxWidth cannot be negative");
+        assertIllegalArgumentException(() -> StringUtils.truncate("abcdefghij", 0, -100), "maxWidth cannot be negative");
+        assertIllegalArgumentException(() -> StringUtils.truncate("abcdefghij", 1, -100), "maxWidth cannot be negative");
+        assertIllegalArgumentException(() -> StringUtils.truncate("abcdefghij", 0, Integer.MIN_VALUE), "maxWidth cannot be negative");
         assertIllegalArgumentException(() -> StringUtils.truncate("abcdefghij", -1, 0), "offset cannot be negative");
         assertIllegalArgumentException(() -> StringUtils.truncate("abcdefghij", -10, 0), "offset cannot be negative");
         assertIllegalArgumentException(() -> StringUtils.truncate("abcdefghij", -100, 1), "offset cannot be negative");