Added Abbreviate renderers
This commit is contained in:
parent
4dd5df1d61
commit
1aa2bc2681
8 changed files with 139 additions and 87 deletions
|
@ -23,6 +23,18 @@ import rife.template.TemplateFactory;
|
|||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class TestFormat {
|
||||
@Test
|
||||
void testAbbreviate() {
|
||||
var t = TemplateFactory.HTML.get("abbreviate");
|
||||
t.setAttribute(TestCase.FOO, TestCase.SAMPLE_TEXT);
|
||||
System.out.println(t.getContent());
|
||||
assertThat(t.getContent()).as("max=12").endsWith("…").hasSize(12);
|
||||
|
||||
t = TemplateFactory.TXT.get("abbreviate");
|
||||
t.setAttribute(TestCase.FOO, TestCase.SAMPLE_TEXT);
|
||||
assertThat(t.getContent()).as("max=8").endsWith("...").hasSize(8);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFormatCreditCard() {
|
||||
var t = TemplateFactory.TXT.get("formatCreditCard");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue