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

TestDict() private method

private TestDict ( ) : void
return void
        public void TestDict()
        {
            string templates =
                    "typeInit ::= [\"int\":\"0\", \"float\":\"0.0\"] " + newline +
                    "var(type,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.Add("type", "int");
            st.Add("name", "x");
            string expecting = "int x = 0;";
            string result = st.Render();
            Assert.AreEqual(expecting, result);
        }