Antlr4.Test.StringTemplate.TestGroupSyntax.TestMessedUpTemplateDoesntCauseRuntimeError C# (CSharp) Method

TestMessedUpTemplateDoesntCauseRuntimeError() private method

private TestMessedUpTemplateDoesntCauseRuntimeError ( ) : void
return void
        public void TestMessedUpTemplateDoesntCauseRuntimeError()
        {
            string templates =
                "main(p) ::= <<\n" +
                "<f(x=\"abc\")>\n" +
                ">>\n" +
                "\n" +
                "f() ::= <<\n" +
                "<x>\n" +
                ">>\n";
            writeFile(tmpdir, "t.stg", templates);

            TemplateGroupFile group;
            ErrorBuffer errors = new ErrorBuffer();
            group = new TemplateGroupFile(Path.Combine(tmpdir, "t.stg"));
            group.Listener = errors;
            Template st = group.GetInstanceOf("main");
            st.Render();

            string expected = "[context [/main] 1:1 attribute x isn't defined," +
                              " context [/main] 1:1 passed 1 arg(s) to template /f with 0 declared arg(s)," +
                              " context [/main /f] 1:1 attribute x isn't defined]";
            string result = errors.Errors.ToListString();
            Assert.AreEqual(expected, result);
        }