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() {
1308
1308
System .out .println (sw );
1309
1309
}
1310
1310
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
+
1311
1332
public void testTemplateFunction () throws IOException {
1312
1333
MustacheFactory mf = createMustacheFactory ();
1313
1334
Mustache m = mf .compile (new StringReader ("{{#i}}{{{test}}}{{f}}{{/i}}" +
You can’t perform that action at this time.
0 commit comments