Antlr4.Test.StringTemplate.TestSyntaxErrors.TestEOFInExpr C# (CSharp) Méthode

TestEOFInExpr() private méthode

private TestEOFInExpr ( ) : void
Résultat void
        public void TestEOFInExpr()
        {
            string templates =
                "foo() ::= \"hi <name:{x|[<aaa.bb>]}\"\n";
            writeFile(tmpdir, "t.stg", templates);

            TemplateGroupFile group;
            ITemplateErrorListener errors = new ErrorBuffer();
            group = new TemplateGroupFile(Path.Combine(tmpdir, "t.stg"));
            group.Listener = errors;
            group.Load(); // force load
            string expected = "t.stg 1:34: premature EOF" + newline;
            string result = errors.ToString();
            Assert.AreEqual(expected, result);
        }