mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add test
This commit is contained in:
parent
3037cb222c
commit
68e5ced2bd
@ -36,4 +36,19 @@ public class StrFormatterTest {
|
|||||||
String result3 = StrFormatter.formatWith("this is \\\\? for ?", "?", "a", "b");
|
String result3 = StrFormatter.formatWith("this is \\\\? for ?", "?", "a", "b");
|
||||||
Assert.assertEquals("this is \\a for b", result3);
|
Assert.assertEquals("this is \\a for b", result3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void formatWithTest2() {
|
||||||
|
//通常使用
|
||||||
|
String result1 = StrFormatter.formatWith("this is $$$ for $$$", "$$$", "a", "b");
|
||||||
|
Assert.assertEquals("this is a for b", result1);
|
||||||
|
|
||||||
|
//转义?
|
||||||
|
String result2 = StrFormatter.formatWith("this is \\$$$ for $$$", "$$$", "a", "b");
|
||||||
|
Assert.assertEquals("this is $$$ for a", result2);
|
||||||
|
|
||||||
|
//转义\
|
||||||
|
String result3 = StrFormatter.formatWith("this is \\\\$$$ for $$$", "$$$", "a", "b");
|
||||||
|
Assert.assertEquals("this is \\a for b", result3);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user