mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add slash for path
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package cn.hutool.core.text;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class CharSequenceUtilTest {
|
||||
|
||||
@Test
|
||||
public void addPrefixIfNotTest(){
|
||||
String str = "hutool";
|
||||
String result = CharSequenceUtil.addPrefixIfNot(str, "hu");
|
||||
Assert.assertEquals(str, result);
|
||||
|
||||
result = CharSequenceUtil.addPrefixIfNot(str, "Good");
|
||||
Assert.assertEquals("Good" + str, result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void addSuffixIfNotTest(){
|
||||
String str = "hutool";
|
||||
String result = CharSequenceUtil.addSuffixIfNot(str, "tool");
|
||||
Assert.assertEquals(str, result);
|
||||
|
||||
result = CharSequenceUtil.addSuffixIfNot(str, " is Good");
|
||||
Assert.assertEquals( str + " is Good", result);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user