Antlr4.Test.StringTemplate.TestImports.TestImportRelativeGroupFile C# (CSharp) Метод

TestImportRelativeGroupFile() приватный Метод

private TestImportRelativeGroupFile ( ) : void
Результат void
        public void TestImportRelativeGroupFile()
        {
            /*
            dir
                group1.stg		that imports group2.stg in same dir with just filename
                subdir
                    group2.stg	has c()
             */
            string dir = tmpdir;
            string groupFile =
                "import \"subdir/group2.stg\"\n" +
                "a() ::= \"g1 a\"\n" +
                "b() ::= \"<c()>\"\n";
            writeFile(dir, "group1.stg", groupFile);

            groupFile =
                "c() ::= \"g2 c\"\n";
            writeFile(dir, Path.Combine("subdir", "group2.stg"), groupFile);

            TemplateGroup group1 = new TemplateGroupFile(Path.Combine(dir, "group1.stg"));
            Template st = group1.GetInstanceOf("c"); // should see c()
            string expected = "g2 c";
            string result = st?.Render();
            Assert.AreEqual(expected, result);
        }