Antlr4.Test.StringTemplate.TestDictionaries.TestDictValuesAreTemplates C# (CSharp) Method

TestDictValuesAreTemplates() private method

private TestDictValuesAreTemplates ( ) : void
return void
        public void TestDictValuesAreTemplates()
        {
            string templates =
                    "typeInit ::= [\"int\":{0<w>}, \"float\":{0.0<w>}] " + newline +
                    "var(type,w,name) ::= \"<type> <name> = <typeInit.(type)>;\"" + newline
                    ;
            writeFile(tmpdir, "test.stg", templates);
            TemplateGroup group = new TemplateGroupFile(Path.Combine(tmpdir, "test.stg"));
            Template st = group.GetInstanceOf("var");
            st.impl.Dump();
            st.Add("w", "L");
            st.Add("type", "int");
            st.Add("name", "x");
            string expecting = "int x = 0L;";
            string result = st.Render();
            Assert.AreEqual(expecting, result);
        }