Antlr4.Test.StringTemplate.TestCompiler.TestOptions C# (CSharp) Method

TestOptions() private method

private TestOptions ( ) : void
return void
        public void TestOptions()
        {
            string template = "hi <name; anchor, wrap=foo(), separator=\", \">";
            CompiledTemplate code = new TemplateCompiler(new TemplateGroup()).Compile(template);
            string asmExpected =
                "write_str 0, " +
                "load_attr 1, " +
                "options, " +
                "load_str 2, " +
                "store_option 0, " +
                "new 3 0, " +
                "store_option 4, " +
                "load_str 4, " +
                "store_option 3, " +
                "write_opt";
            string stringsExpected = // the ", , ," is the ", " separator string
                "[hi , name, true, foo, , ]";
            string stringsResult = code.strings.ToListString();
            Assert.AreEqual(stringsExpected, stringsResult);
            string asmResult = code.GetInstructions();
            Assert.AreEqual(asmExpected, asmResult);
        }