예제 #1
0
 public void TestIsCFunction()
 {
     LuaState L = null;
     using (L = new LuaState())
     {
         L.PushNil()
             .PushNumber(123.45)
             .PushInteger(987)
             .PushString("Test")
             .PushString("5.6")
             .PushString("5D")
             .PushString("5z")
             .PushBoolean(true)
             .PushCClosure(l => 0, 0)
             //.PushLightUserData(DateTime.Now)
             .PushGlobalTable()
             ;
         // TODO Add test with Lua script function
         Assert.False(L.IsCFunction(1));
         Assert.False(L.IsCFunction(2));
         Assert.False(L.IsCFunction(3));
         Assert.False(L.IsCFunction(4));
         Assert.False(L.IsCFunction(5));
         Assert.False(L.IsCFunction(6));
         Assert.False(L.IsCFunction(7));
         Assert.False(L.IsCFunction(8));
         Assert.True(L.IsCFunction(9));
         Assert.False(L.IsCFunction(10));
         Assert.False(L.IsCFunction(11));
         Assert.False(L.IsCFunction(12));
     }
 }