示例#1
0
        public void innerViewBuildtest1()
        {
            InnerViewBuilder innerViewBuilder = new InnerViewBuilder("sub main\ncall main");
            InnerView        innerView        = innerViewBuilder.Build();
            bool             actual           = innerView.Functions.ContainsKey("main");

            Assert.AreEqual(true, actual);
            CallInst inst = (CallInst)innerView.Functions["main"][0];

            Assert.AreEqual("CALL", inst.Type.ToString());
        }
示例#2
0
        public void innerViewBuildtest2()
        {
            InnerViewBuilder innerViewBuilder = new InnerViewBuilder("sub main\nset a 2");
            InnerView        innerView        = innerViewBuilder.Build();
            bool             actual           = innerView.Functions.ContainsKey("main");

            Assert.AreEqual(true, actual);
            SetInst inst = (SetInst)innerView.Functions["main"][0];

            Assert.AreEqual("SET", inst.Type.ToString());
        }