Search in sources :

Example 1 with SoyTypeRegistry

use of com.google.template.soy.types.SoyTypeRegistry in project closure-templates by google.

the class ResolveExpressionTypesVisitorTest method testProtoInitTyping.

@Test
public void testProtoInitTyping() {
    SoyTypeRegistry typeRegistry = new SoyTypeRegistry.Builder().addDescriptors(ImmutableList.of(ExampleExtendable.getDescriptor())).build();
    SoyFileSetNode soyTree = SoyFileSetParserBuilder.forFileContents(constructTemplateSource("{let $proto: example.ExampleExtendable() /}", "{assertType('example.ExampleExtendable', $proto)}")).addSoyFunction(ASSERT_TYPE_FUNCTION).typeRegistry(typeRegistry).parse().fileSet();
    assertTypes(soyTree);
}
Also used : SoyTypeRegistry(com.google.template.soy.types.SoyTypeRegistry) SoyFileSetParserBuilder(com.google.template.soy.SoyFileSetParserBuilder) SoyFileSetNode(com.google.template.soy.soytree.SoyFileSetNode) Test(org.junit.Test)

Aggregations

SoyFileSetParserBuilder (com.google.template.soy.SoyFileSetParserBuilder)1 SoyFileSetNode (com.google.template.soy.soytree.SoyFileSetNode)1 SoyTypeRegistry (com.google.template.soy.types.SoyTypeRegistry)1 Test (org.junit.Test)1