예제 #1
0
        public void TestRawSetGetP()
        {
            LuaState L = null;
            using (L = new LuaState())
            {
                L.CreateTable(0, 0);
                Assert.Equal(1, L.GetTop());

                L.PushString("Value");
                L.RawSetP(1, new IntPtr(2));
                Assert.Equal(1, L.GetTop());

                L.RawGetP(1, new IntPtr(1));
                Assert.Equal(2, L.GetTop());
                Assert.Equal(true, L.IsNil(-1));

                L.RawGetP(1, new IntPtr(2));
                Assert.Equal(3, L.GetTop());
                Assert.Equal(true, L.IsString(-1));
                Assert.Equal("Value", L.ToString(-1));
            }
        }