Search in sources :

Example 26 with SoyDict

use of com.google.template.soy.data.SoyDict in project closure-templates by google.

the class RenderVisitorTest method testRenderSelectWithRuntimeErrors.

@Test
public void testRenderSelectWithRuntimeErrors() throws Exception {
    String templateBody = "{@param gender: ?}\n" + "{@param person: ?}\n" + "  {msg desc=\"Simple select message\"}\n" + "    {select $gender}\n" + "      {case 'female'}{$person} shared her photos.\n" + "      {default}{$person} shared his photos.\n" + "    {/select}\n" + "  {/msg}\n";
    SoyDict data = SoyValueConverterUtility.newDict("person", "The president", "gender", 100);
    assertRenderExceptionWithData(templateBody, data, "Select expression \"$gender\" doesn't evaluate to string.");
}
Also used : SoyDict(com.google.template.soy.data.SoyDict) Test(org.junit.Test)

Aggregations

SoyDict (com.google.template.soy.data.SoyDict)26 Test (org.junit.Test)25 SoyTofuException (com.google.template.soy.tofu.SoyTofuException)6 BufferingAppendable (com.google.template.soy.data.LoggingAdvisingAppendable.BufferingAppendable)2 SoyFutureException (com.google.template.soy.data.SoyFutureException)2 SoyLegacyObjectMap (com.google.template.soy.data.SoyLegacyObjectMap)2 SoyValue (com.google.template.soy.data.SoyValue)2 CompiledTemplate (com.google.template.soy.jbcsrc.shared.CompiledTemplate)2 CompiledTemplates (com.google.template.soy.jbcsrc.shared.CompiledTemplates)2 RenderContext (com.google.template.soy.jbcsrc.shared.RenderContext)2 SoyRecord (com.google.template.soy.data.SoyRecord)1 SoyValueProvider (com.google.template.soy.data.SoyValueProvider)1 SoyMapImpl (com.google.template.soy.data.internal.SoyMapImpl)1 TemplateMetadata (com.google.template.soy.jbcsrc.shared.TemplateMetadata)1 TemplateRegistry (com.google.template.soy.soytree.TemplateRegistry)1 Flushable (java.io.Flushable)1 HashMap (java.util.HashMap)1