From 3194a39235e9dadd4d713913e6a7437a3daf8c43 Mon Sep 17 00:00:00 2001 From: Zhuopeng Tan Date: Fri, 18 Feb 2022 12:36:41 +0800 Subject: [PATCH] Fix test cases ReadArrayField & WriteArrayField --- Assets/Slua/example/test/test.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Slua/example/test/test.cs b/Assets/Slua/example/test/test.cs index 63ff8995..7987342a 100644 --- a/Assets/Slua/example/test/test.cs +++ b/Assets/Slua/example/test/test.cs @@ -1049,7 +1049,7 @@ public void ReadArrayField () string[] arr = new string [] { "str1", "str2", "str3" }; lua ["netobj"] = arr; lua.doString ("val=netobj[1]"); - Assert.AreEqual ("str2", lua["val"]); + Assert.AreEqual (arr[0], lua["val"]); //Debug.Log("new val(from array to Lua)="+val); } @@ -1061,7 +1061,7 @@ public void WriteArrayField () string[] arr = new string [] { "str1", "str2", "str3" }; lua ["netobj"] = arr; lua.doString ("netobj[1]='test'"); - Assert.AreEqual ("test", arr [1]); + Assert.AreEqual ("test", arr [0]); //Debug.Log("new val(from Lua to array)="+arr[1]); }