From f61c843e69f32aef45b53bd2fa99329b339bd387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B3=E5=8A=AD=E6=98=8E?= <626546063@qq.com> Date: Mon, 26 Jul 2021 02:16:16 +0000 Subject: [PATCH] add test for replace --- .../test/java/cn/hutool/core/text/CharSequenceUtilTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hutool-core/src/test/java/cn/hutool/core/text/CharSequenceUtilTest.java b/hutool-core/src/test/java/cn/hutool/core/text/CharSequenceUtilTest.java index 2abb326c3..a4178679e 100644 --- a/hutool-core/src/test/java/cn/hutool/core/text/CharSequenceUtilTest.java +++ b/hutool-core/src/test/java/cn/hutool/core/text/CharSequenceUtilTest.java @@ -5,6 +5,12 @@ import org.junit.Test; public class CharSequenceUtilTest { + @Test + public void replace() { + String actual = CharSequenceUtil.replace("SSM15930297701BeryAllen", Pattern.compile("[0-9]"), matcher -> ""); + Assert.assertEquals("SSMBeryAllen", actual); + } + @Test public void addPrefixIfNotTest(){ String str = "hutool";