Use GetDebugId in custom instance properties test

This commit is contained in:
Filip Tibell 2023-10-25 11:14:08 +02:00
parent e3981c8db2
commit f860821498
No known key found for this signature in database

View file

@ -36,13 +36,12 @@ local _ = part.PassingPartTest
local counters = {}
roblox.implementProperty("Instance", "Counter", function(instance)
-- FIXME: Instances do not make for unique table keys for some reason ...
local value = counters[tostring(instance)] or 0
local value = counters[instance:GetDebugId()] or 0
value += 1
counters[tostring(instance)] = value
counters[instance:GetDebugId()] = value
return value
end, function(instance, value)
counters[tostring(instance)] = value
counters[instance:GetDebugId()] = value
end)
assert(inst.Counter == 1, "implementProperty callback should return proper values")