aboutsummaryrefslogtreecommitdiff
path: root/deep_test/deeptest.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--deep_test/deeptest.lua13
1 files changed, 10 insertions, 3 deletions
diff --git a/deep_test/deeptest.lua b/deep_test/deeptest.lua
index 250eb98..bab91d9 100644
--- a/deep_test/deeptest.lua
+++ b/deep_test/deeptest.lua
@@ -38,9 +38,13 @@ local printDeep = function( prefix_, obj_, t_)
38 print ("uv #" .. uvi, type( uservalue), uservalue, type(uservalue) == "function" and uservalue() or "") 38 print ("uv #" .. uvi, type( uservalue), uservalue, type(uservalue) == "function" and uservalue() or "")
39 end 39 end
40 if t_ then 40 if t_ then
41 for k, v in pairs( t_) do 41 local count = 0
42 for k, v in ipairs( t_) do
42 print( "t["..tostring(k).."]", v) 43 print( "t["..tostring(k).."]", v)
44 count = count + 1
43 end 45 end
46 -- we should have only 2 indexed entries with the same value
47 assert(count == 2 and t_[1] == t_[2])
44 end 48 end
45 print() 49 print()
46end 50end
@@ -56,8 +60,11 @@ local performTest = function( obj_)
56 60
57 local t = 61 local t =
58 { 62 {
59 ["key"] = obj_, 63 -- two indices with an identical value: we should also have identical values on the other side (even if not the same as the original ones when they are clonables)
60 [obj_] = "val" -- this one won't transfer because we don't support full uservalue as keys 64 obj_,
65 obj_,
66 -- this one won't transfer because we don't support full uservalue as keys
67 [obj_] = "val"
61 } 68 }
62 69
63 -- read back the contents of the object 70 -- read back the contents of the object