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

TestDictDefaultValue() private method

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