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

commit 4bca9b474de3a05dff579d8e085acda5901c87b0
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Tue Apr 15 14:58:21 2025 -0400

    Add org.apache.commons.lang3.StringUtilsTest.testToCodePointsEmoji()
---
 src/test/java/org/apache/commons/lang3/StringUtilsTest.java | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsTest.java 
b/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
index 9c5168680..088bc2fd8 100644
--- a/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
@@ -2867,6 +2867,19 @@ public void testToCodePoints() {
         assertArrayEquals(new int[] { 'a', 'b', 'c' }, 
StringUtils.toCodePoints("abc"));
     }
 
+    @Test
+    public void testToCodePointsEmoji() {
+        assertArrayEquals(ArrayFill.fill(new int[14], 129418), 
StringUtils.toCodePoints("🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊"));
+        assertArrayEquals(new int[] { 128105, 127995, 8205, 128104, 127995, 
8205, 128102, 127995, 8205, 128102, 127995, 128105, 127996, 8205, 128104, 
127996,
+                8205, 128102, 127996, 8205, 128102, 127996, 128105, 127997, 
8205, 128104, 127997, 8205, 128102, 127997, 8205, 128102, 127997, 128105, 
127998,
+                8205, 128104, 127998, 8205, 128102, 127998, 8205, 128102, 
127998, 128105, 127999, 8205, 128104, 127999, 8205, 128102, 127999, 8205, 
128102,
+                127999, 128105, 127995, 8205, 128104, 127995, 8205, 128102, 
127995, 8205, 128102, 127995, 128105, 127996, 8205, 128104, 127996, 8205, 
128102,
+                127996, 8205, 128102, 127996, 128105, 127997, 8205, 128104, 
127997, 8205, 128102, 127997, 8205, 128102, 127997, 128105, 127998, 8205, 
128104,
+                127998, 8205, 128102, 127998, 8205, 128102, 127998, 128105, 
127999, 8205, 128104, 127999, 8205, 128102, 127999, 8205, 128102, 127999 },
+                StringUtils.toCodePoints(
+                        
"👩🏻‍👨🏻‍👦🏻‍👦🏻👩🏼‍👨🏼‍👦🏼‍👦🏼👩🏽‍👨🏽‍👦🏽‍👦🏽👩🏾‍👨🏾‍👦🏾‍👦🏾👩🏿‍👨🏿‍👦🏿‍👦🏿👩🏻‍👨🏻‍👦🏻‍👦🏻👩🏼‍👨🏼‍👦🏼‍👦🏼👩🏽‍👨🏽‍👦🏽‍👦🏽👩🏾‍👨🏾‍👦🏾‍👦🏾👩🏿‍👨🏿‍👦🏿‍👦🏿"));
+    }
+
     /**
      * Tests {@link StringUtils#toEncodedString(byte[], Charset)}
      *

Reply via email to