File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
metadata/org.thymeleaf/thymeleaf/3.1.0.RC1
tests/src/org.thymeleaf/thymeleaf/3.1.0.RC1/src/test/java/org/thymeleaf Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 404
404
"condition" : {
405
405
"typeReachable" : " org.thymeleaf.standard.expression.StandardExpressionParser"
406
406
}
407
+ },
408
+ {
409
+ "name" : " org.thymeleaf.engine.IterationStatusVar" ,
410
+ "allDeclaredConstructors" : true ,
411
+ "allPublicConstructors" : true ,
412
+ "allDeclaredMethods" : true ,
413
+ "allPublicMethods" : true ,
414
+ "allDeclaredClasses" : true ,
415
+ "allPublicClasses" : true ,
416
+ "condition" : {
417
+ "typeReachable" : " org.thymeleaf.standard.expression.OGNLVariableExpressionEvaluator"
418
+ }
407
419
}
408
420
]
Original file line number Diff line number Diff line change @@ -185,5 +185,13 @@ void renderTemporalsExpression() {
185
185
assertThat (output ).startsWith ("<p>15/06/1981</p>" );
186
186
}
187
187
188
-
188
+ @ Test
189
+ void renderIteratorStatus () {
190
+ TemplateEngine templateEngine = new TemplateEngine ();
191
+ Context context = new Context ();
192
+ context .setVariable ("array" , new String [] {"one" , "two" });
193
+ String template = "<ul><li th:each=\" v, iterStat:${array}\" th:class=\" ${iterStat.odd}? 'odd'\" th:text=\" ${v}\" >value</li></ul>" ;
194
+ String output = templateEngine .process (template , context );
195
+ assertThat (output ).startsWith ("<ul><li class=\" odd\" >one</li><li>two</li></ul>" );
196
+ }
189
197
}
You can’t perform that action at this time.
0 commit comments