Skip to content
Snippets Groups Projects
Commit 74b7079b authored by Johannes Mey's avatar Johannes Mey
Browse files

do not escape anything in mustache, test it for preamble

parent ec2ab792
No related branches found
No related tags found
2 merge requests!101.0.0,!7Resolve "XML-escaping is used"
Pipeline #12762 passed
@startuml @startuml
{{#PrintConfig}} {{#PrintConfig}}
scale {{Scale}} scale {{{Scale}}}
{{#Headers}} {{#Headers}}
{{Value}} {{{Value}}}
{{/Headers}} {{/Headers}}
{{/PrintConfig}} {{/PrintConfig}}
{{#DumpNodes}} {{#DumpNodes}}
{{#isAstNode}} {{#isAstNode}}
{{^Invisible}} {{^Invisible}}
object "{{{labelAndTextColor}}}" as {{name}} {{#backgroundColor}}#{{{backgroundColor}}}{{/backgroundColor}} { object "{{{labelAndTextColor}}}" as {{{name}}} {{#backgroundColor}}#{{{backgroundColor}}}{{/backgroundColor}} {
{{#DumpTokens}} {{#DumpTokens}}
{{#isDumpValueToken}} {{#isDumpValueToken}}
{{label}} = {{{Value}}} {{{label}}} = {{{Value}}}
{{/isDumpValueToken}} {{/isDumpValueToken}}
{{/DumpTokens}} {{/DumpTokens}}
} }
...@@ -24,7 +24,7 @@ object "{{{labelAndTextColor}}}" as {{name}} {{#backgroundColor}}#{{{backgroundC ...@@ -24,7 +24,7 @@ object "{{{labelAndTextColor}}}" as {{name}} {{#backgroundColor}}#{{{backgroundC
{{#DumpTokens}} {{#DumpTokens}}
{{^Invisible}} {{^Invisible}}
{{^isDumpValueToken}} {{^isDumpValueToken}}
{{outerNodeName}} ..> {{innerNodeName}} : {{label}} {{{outerNodeName}}} ..> {{{innerNodeName}}} : {{{label}}}
{{/isDumpValueToken}} {{/isDumpValueToken}}
{{/Invisible}} {{/Invisible}}
{{/DumpTokens}} {{/DumpTokens}}
...@@ -32,13 +32,13 @@ object "{{{labelAndTextColor}}}" as {{name}} {{#backgroundColor}}#{{{backgroundC ...@@ -32,13 +32,13 @@ object "{{{labelAndTextColor}}}" as {{name}} {{#backgroundColor}}#{{{backgroundC
{{#isList}} {{#isList}}
{{#InnerDumpNodes}} {{#InnerDumpNodes}}
{{#bothVisible}} {{#bothVisible}}
{{outerNodeName}} *-- {{innerNodeName}} : {{label}} {{{outerNodeName}}} *-- {{{innerNodeName}}} : {{{label}}}
{{/bothVisible}} {{/bothVisible}}
{{/InnerDumpNodes}} {{/InnerDumpNodes}}
{{/isList}} {{/isList}}
{{^isList}} {{^isList}}
{{#bothVisible}} {{#bothVisible}}
{{outerNodeName}} *-- {{innerNodeName}} : {{label}} {{{outerNodeName}}} *-- {{{innerNodeName}}} : {{{label}}}
{{/bothVisible}} {{/bothVisible}}
{{/isList}} {{/isList}}
{{/DumpChildNodes}} {{/DumpChildNodes}}
...@@ -46,27 +46,27 @@ object "{{{labelAndTextColor}}}" as {{name}} {{#backgroundColor}}#{{{backgroundC ...@@ -46,27 +46,27 @@ object "{{{labelAndTextColor}}}" as {{name}} {{#backgroundColor}}#{{{backgroundC
{{#isList}} {{#isList}}
{{#InnerDumpNodes}} {{#InnerDumpNodes}}
{{#bothVisible}} {{#bothVisible}}
{{outerNodeName}} {{#Bidirectional}}<{{/Bidirectional}}--> {{innerNodeName}} : {{label}} {{{outerNodeName}}} {{#Bidirectional}}<{{/Bidirectional}}--> {{{innerNodeName}}} : {{{label}}}
{{/bothVisible}} {{/bothVisible}}
{{/InnerDumpNodes}} {{/InnerDumpNodes}}
{{/isList}} {{/isList}}
{{^isList}} {{^isList}}
{{#bothVisible}} {{#bothVisible}}
{{outerNodeName}} {{#Bidirectional}}<{{/Bidirectional}}--> {{innerNodeName}} : {{label}} {{{outerNodeName}}} {{#Bidirectional}}<{{/Bidirectional}}--> {{{innerNodeName}}} : {{{label}}}
{{/bothVisible}} {{/bothVisible}}
{{/isList}} {{/isList}}
{{/DumpRelations}} {{/DumpRelations}}
{{^Invisible}} {{^Invisible}}
{{#InvisiblePath}} {{#InvisiblePath}}
{{#InnerDumpNodes}} {{#InnerDumpNodes}}
{{outerNodeName}} o.. {{innerNodeName}} {{{outerNodeName}}} o.. {{{innerNodeName}}}
{{/InnerDumpNodes}} {{/InnerDumpNodes}}
{{/InvisiblePath}} {{/InvisiblePath}}
{{/Invisible}} {{/Invisible}}
{{#PrintConfig}}{{#orderChildren}} {{#PrintConfig}}{{#orderChildren}}
{{#myChildren}} {{#myChildren}}
{{#hasSuccessor}} {{#hasSuccessor}}
{{name}} -[hidden]right-> {{#successor}}{{name}}{{/successor}} {{{name}}} -[hidden]right-> {{#successor}}{{{name}}}{{/successor}}
{{/hasSuccessor}} {{/hasSuccessor}}
{{/myChildren}} {{/myChildren}}
{{/orderChildren}}{{/PrintConfig}} {{/orderChildren}}{{/PrintConfig}}
...@@ -75,7 +75,7 @@ object "{{{labelAndTextColor}}}" as {{name}} {{#backgroundColor}}#{{{backgroundC ...@@ -75,7 +75,7 @@ object "{{{labelAndTextColor}}}" as {{name}} {{#backgroundColor}}#{{{backgroundC
{{#Debug}} {{#Debug}}
legend right legend right
%date() %date()
dumpAst: {{version}} dumpAst: {{{version}}}
plantuml: %version() plantuml: %version()
endlegend endlegend
{{/Debug}} {{/Debug}}
......
...@@ -28,6 +28,17 @@ public class TestSimple { ...@@ -28,6 +28,17 @@ public class TestSimple {
assertEquals(0, actualRoot.getNumDumpRelation()); assertEquals(0, actualRoot.getNumDumpRelation());
} }
@Test
public void testCustomPreamble() {
Root root = createRoot(null, null);
String preamble = "{<\n>\n}";
ExposingDumpBuilder builder = new ExposingDumpBuilder(root);
builder.excludeNullNodes().customPreamble(preamble);
DumpAst dumpAst = builder.build();
String puml = dumpAst.toPlantUml();
assertThat(puml).contains(preamble);
}
@Test void testChildlessNonterminal() { @Test void testChildlessNonterminal() {
Root root = createRoot(createA(A_NAME, a -> a.setD(new D())), null); Root root = createRoot(createA(A_NAME, a -> a.setD(new D())), null);
List<DumpNode> nodes = TestUtils.dumpModel(root); List<DumpNode> nodes = TestUtils.dumpModel(root);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment