|
@@ -4,6 +4,7 @@ import org.junit.Assert;
|
|
|
import org.junit.Test;
|
|
|
|
|
|
import java.util.Collections;
|
|
|
+import java.util.function.Function;
|
|
|
|
|
|
import static org.junit.Assert.*;
|
|
|
|
|
@@ -18,6 +19,17 @@ public class TemplateParserTest {
|
|
|
Assert.assertEquals(result, "test-test-test");
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ public void testLargeExpr() {
|
|
|
+ String expr = "";
|
|
|
+ for (int i = 0; i < 1000; i++) {
|
|
|
+ expr += "expr_" + i;
|
|
|
+ }
|
|
|
+ String result = TemplateParser.parse("${"+expr+"}", Function.identity());
|
|
|
+
|
|
|
+ assertEquals(expr,result);
|
|
|
+
|
|
|
+ }
|
|
|
@Test
|
|
|
public void testLarge() {
|
|
|
String str = "";
|
|
@@ -30,4 +42,13 @@ public class TemplateParserTest {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @Test
|
|
|
+ public void testNest() {
|
|
|
+
|
|
|
+
|
|
|
+ String result = TemplateParser.parse("test-${properties.a-r-str}", Collections.singletonMap("properties", Collections.singletonMap("a-r-str","123")));
|
|
|
+
|
|
|
+ Assert.assertEquals(result, "test-123");
|
|
|
+ }
|
|
|
+
|
|
|
}
|