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

TestDictDefaultStringAsKey() private method

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