File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
compiler/src/test/java/com/github/mustachejava Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1308,6 +1308,27 @@ public void testEmptyDot() {
13081308 System .out .println (sw );
13091309 }
13101310
1311+ @ Test
1312+ public void testCase () {
1313+ String template = "Hello {{user.name}}" ;
1314+
1315+ DefaultMustacheFactory factory = new DefaultMustacheFactory ();
1316+ Mustache m = factory .compile (new StringReader (template ), "test" );
1317+
1318+ Map <String , Object > scopes = new HashMap <>();
1319+ Map <String , String > value = new HashMap <>();
1320+ value .put ("name" , "Test" );
1321+ scopes .put ("user" , value );
1322+
1323+ //Expected this to output 'Hello'
1324+ String result = m .execute (new StringWriter (), (Map <String , Object >) null ).toString ();
1325+ System .out .println (result ); //prints 'Hello'
1326+
1327+ //Expected this to output 'Hello Test' instead prints 'Hello'
1328+ result = m .execute (new StringWriter (), scopes ).toString ();
1329+ System .out .println (result ); //prints 'Hello'
1330+ }
1331+
13111332 public void testTemplateFunction () throws IOException {
13121333 MustacheFactory mf = createMustacheFactory ();
13131334 Mustache m = mf .compile (new StringReader ("{{#i}}{{{test}}}{{f}}{{/i}}" +
You can’t perform that action at this time.
0 commit comments