AjTalk.Tests.Compilers.Vm.BytecodeCompilerTests.CompileTwoSimpleCommand C# (CSharp) Метод

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

private CompileTwoSimpleCommand ( ) : void
Результат void
        public void CompileTwoSimpleCommand()
        {
            ModelParser parser = new ModelParser("a := 1. b := 2");
            this.compiler.CompileExpressions(parser.ParseExpressions());

            Assert.IsNotNull(this.block);
            Assert.AreEqual(2, this.block.NoConstants);
            Assert.AreEqual(0, this.block.NoLocals);
            Assert.AreEqual(2, this.block.NoGlobalNames);
            Assert.IsNotNull(this.block.ByteCodes);
            Assert.AreEqual(8, this.block.ByteCodes.Length);
            Assert.AreEqual(0, this.block.Arity);
            BlockDecompiler decompiler = new BlockDecompiler(this.block);
            var program = decompiler.Decompile();
            Assert.IsNotNull(program);
            Assert.AreEqual(4, program.Count);
            Assert.AreEqual("GetConstant 1", program[0]);
            Assert.AreEqual("SetGlobalVariable a", program[1]);
            Assert.AreEqual("GetConstant 2", program[2]);
            Assert.AreEqual("SetGlobalVariable b", program[3]);
        }