Antlr4.Test.StringTemplate.TestGroupSyntaxErrors.TestMissingImportString C# (CSharp) Method

TestMissingImportString() private method

private TestMissingImportString ( ) : void
return void
        public void TestMissingImportString()
        {
            string templates =
                "import\n" +
                "foo() ::= <<>>\n";
            writeFile(tmpdir, "t.stg", templates);

            ITemplateErrorListener errors = new ErrorBuffer();
            TemplateGroup group = new TemplateGroupFile(Path.Combine(tmpdir, "t.stg"));
            group.Listener = errors;
            group.Load(); // force load
            string expected = "t.stg 2:0: mismatched input 'foo' expecting STRING" + newline +
                "t.stg 2:3: missing EndOfFile at '('" + newline;
            string result = errors.ToString();
            Assert.AreEqual(expected, result);
        }